openapi: 3.0.0 info: title: Nexos AI Public API Production version: 1.0.0 servers: - url: https://api.nexos.ai security: - bearerAuth: [] - apiKeyHeader: [] tags: - name: Agent Management description: Manage agents. - name: Assistant Management description: Manage assistants. - name: Audio description: Generate audio or text from audio or text input. - name: Batches description: Create and run large groups of requests asynchronously. Batches are only available for OpenAI models. - name: Budget Limit Management description: Manage company budget limits. - name: Chat description: Generate a response from conversation messages. - name: Company Management description: List company API keys and their usage. - name: Embeddings description: Create vector embeddings for input text. - name: Files description: Upload and manage files used by other endpoints. - name: Images description: Generate images from image or text input. - name: Messages description: Anthropic-native Messages API for prompt-cache-preserving passthrough. - name: Models description: List available models. - name: Responses description: Create and manage model responses. - name: Storage description: Upload and manage media files. - name: Team Management description: Manage teams, API keys, and models. - name: User Management description: Manage user API keys. paths: /v1/agents: get: operationId: get-agents-v1 summary: List agents for a specific user tags: - Agent Management description: Retrieve list of agents for a specific user. parameters: - name: limit in: query required: false description: The number of items to return. schema: type: integer format: int64 default: 100 minimum: 1 maximum: 200 - name: offset in: query required: false description: The number of items to skip. schema: type: integer format: int64 - name: sort_by.field in: query schema: $ref: '#/components/schemas/AgentSortByField' description: Field to sort by, must be used together with sort_by.order. - name: sort_by.order in: query required: false schema: $ref: '#/components/schemas/AgentSortOrder' description: Sort order, must be used together with sort_by.field. - name: include_shared in: query required: false description: Whether to include agents shared with the user. schema: type: boolean default: false responses: '200': $ref: '#/components/responses/AgentListResponse' '404': description: Agent not found. /v1/assistants: get: operationId: get-assistants-v1 deprecated: true summary: List assistants for a specific user. Deprecated, use /v1/agents instead. tags: - Assistant Management description: 'Deprecated: Use /v1/agents instead. Retrieve list of assistants for a specific user.' parameters: - name: limit in: query required: false description: The number of items to return. schema: type: integer format: int64 default: 100 minimum: 1 maximum: 200 - name: offset in: query required: false description: The number of items to skip. schema: type: integer format: int64 - name: sort_by.field in: query schema: $ref: '#/components/schemas/SortByField' description: Field to sort by, must be used together with sort_by.order. - name: sort_by.order in: query required: false schema: $ref: '#/components/schemas/SortOrder' description: Sort order, must be used together with sort_by.field. - name: include_shared in: query required: false description: Whether to include assistants shared with the user. schema: type: boolean default: false responses: '200': $ref: '#/components/responses/AssistantListResponse' '404': description: Assistant not found. /v1/audio/speech: post: operationId: post-audio-speech-v1 summary: Create speech tags: - Audio description: Generate speech audio from text. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SpeechRequest' responses: '200': description: Successful response with an audio speech. content: application/octet-stream: schema: type: string format: binary '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/audio/transcriptions: post: operationId: post-audio-transcriptions-v1 summary: Create transcription tags: - Audio description: Transcribe audio to text. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/TranscriptionRequest' responses: '200': description: OK content: application/json: schema: oneOf: - $ref: '#/components/schemas/TranscriptionResponseJson' - $ref: '#/components/schemas/TranscriptionResponseVerboseJson' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/audio/translations: post: operationId: post-audio-translations-v1 summary: Create translation tags: - Audio description: Translate audio to English text. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/TranslationRequest' responses: '200': description: OK content: application/json: schema: oneOf: - $ref: '#/components/schemas/TranslationResponseJson' - $ref: '#/components/schemas/TranslationResponseVerboseJson' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/batches: post: tags: - Batches operationId: post-batches-v1 summary: Create batch description: 'Create and immediately start a batch from a file of requests that was uploaded beforehand. Batches are only available for OpenAI models.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BatchesRequest' responses: '200': $ref: '#/components/responses/BatchesResponse' '400': description: Invalid request data. '500': description: Server error. /v1/batches/{batch_id}: get: tags: - Batches operationId: get-batch-v1 summary: Retrieve batch description: Look up a single batch by its ID, including its current status and metadata. parameters: - name: batch_id in: path required: true description: The ID of the batch to retrieve schema: type: string - name: model in: query schema: type: string deprecated: true responses: '200': $ref: '#/components/responses/BatchesResponse' '400': description: Invalid batch ID format or malformed request '404': description: Batch not found '500': description: Internal server error /v1/companies/{companyId}/budget_limits: get: operationId: get-company-budget-limits-v1 summary: List budget limits for a company tags: - Budget Limit Management description: Retrieve all budget limits for a specific company. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: limit in: query required: false description: Maximum number of items to return. schema: type: integer format: uint32 minimum: 1 - name: offset in: query required: false description: Number of items to skip. schema: type: integer format: uint32 minimum: 0 responses: '200': $ref: '#/components/responses/CompanyBudgetLimitListResponse' '500': description: Server error. 4XX: description: Client error. put: operationId: put-company-budget-limits-v1 summary: Upsert a budget limit tags: - Budget Limit Management description: Create or update a budget limit for a company. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertCompanyBudgetLimitRequest' responses: '200': $ref: '#/components/responses/CompanyBudgetLimitResponse' '400': description: Invalid request data. delete: operationId: delete-company-budget-limits-v1 summary: Delete a budget limit tags: - Budget Limit Management description: Delete a specific budget limit for a company. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DeleteCompanyBudgetLimitRequest' responses: '204': description: Budget limit deleted successfully. '404': description: Budget limit not found. /v1/companies/{companyId}/budget_limits/bulk: put: operationId: put-company-budget-limits-bulk-v1 summary: Bulk upsert and delete budget limits tags: - Budget Limit Management description: 'Apply many budget-limit changes for a company in a single call. Each item is upserted by default; items with `remove: true` delete the matching row identified by `(company_uuid, target_type, target_uuid, limit_type)`.' parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkUpsertCompanyBudgetLimitRequest' responses: '200': $ref: '#/components/responses/CompanyBudgetLimitListResponse' '400': description: Invalid request data. /v1/chat/completions: post: tags: - Chat operationId: post-chat-completions-v1 summary: Create chat completion description: Generate a response from conversation messages. parameters: - in: query name: fallbacks schema: type: string enum: - 'true' - 'false' required: false description: To use or not fallbacks in chat completion request requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChatCompletionsRequest' responses: '200': $ref: '#/components/responses/ChatCompletionsResponse' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/companies/{companyId}/api_keys/with_usage: get: operationId: get-company-api-keys-with-usage-v1 tags: - Company Management summary: List all company API keys with last usage time description: Returns all API keys (user and team) for the company with pagination and sorting. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: limit in: query required: false description: Number of records per page. schema: type: integer format: int32 - name: offset in: query required: false description: Number of records to skip. schema: type: integer format: int32 minimum: 0 - name: sort_by_field in: query required: false description: 'Sort field: name, key_owner, last_used_at, status.' schema: type: string enum: - name - key_owner - budget_used - budget_limit - status - last_used_at - name: sort_by_order in: query required: false description: 'Sort order: asc, desc.' schema: type: string enum: - asc - desc - name: name in: query required: false description: Filter by API key name (partial match). schema: type: string - name: owner_uuid in: query required: false description: Filter by owner UUID (user or team). schema: type: string responses: '200': $ref: '#/components/responses/CompanyAPIKeysResponse' /v1/companies/{companyId}/users/api_keys/with_usage: get: operationId: get-company-user-api-keys-with-usage-v1 tags: - Company Management summary: List company user API keys aggregated by owner description: Returns the company's user API keys aggregated by owner, with usage and budget information. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: limit in: query required: false description: Maximum number of items to return. schema: type: integer format: int32 minimum: 1 - name: offset in: query required: false description: Number of items to skip. schema: type: integer format: int32 minimum: 0 - name: sort_by_field in: query required: false description: 'Field to sort by: owner_name, status, key_count, budget_used, budget_limit.' schema: type: string enum: - owner_name - key_count - budget_used - budget_limit - name: sort_by_order in: query required: false description: 'Sort order: asc, desc.' schema: type: string enum: - asc - desc - name: owner_name in: query required: false description: Filter by owner name (partial match). schema: type: string responses: '200': $ref: '#/components/responses/UserAPIKeyOwnersResponse' /v1/companies/{companyId}/users/{userId}/api_keys/with_usage: get: operationId: list-user-api-keys-with-usage-v1 tags: - Company Management summary: List user API keys with last usage time description: Returns all API keys of a specific user in the company, with last usage time. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: userId in: path required: true description: The UUID of the user. schema: type: string - name: limit in: query required: false description: Maximum number of items to return. schema: type: integer format: int32 minimum: 1 - name: offset in: query required: false description: Number of items to skip. schema: type: integer format: int32 minimum: 0 - name: name in: query required: false description: Filter by API key name (partial match). schema: type: string - name: sort_by_field in: query required: false description: 'Field to sort by: name, owner_name, last_used_at, status, budget_limit, budget_used.' schema: type: string enum: - name - last_used_at - owner_name - status - name: sort_by_order in: query required: false description: 'Sort order: asc, desc.' schema: type: string enum: - asc - desc responses: '200': $ref: '#/components/responses/UserAPIKeysWithUsageResponse' /v1/companies/{companyId}/teams/api_keys/with_usage: get: operationId: get-company-team-api-keys-with-usage-v1 tags: - Company Management summary: List company team API keys aggregated by team description: Returns the company's team API keys aggregated by team, with usage and budget information. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: limit in: query required: false description: Maximum number of items to return. schema: type: integer format: int32 minimum: 1 - name: offset in: query required: false description: Number of items to skip. schema: type: integer format: int32 minimum: 0 - name: sort_by_field in: query required: false description: 'Field to sort by: team_name, status, key_count, budget_used, budget_limit.' schema: type: string enum: - team_name - key_count - budget_used - budget_limit - name: sort_by_order in: query required: false description: 'Sort order: asc, desc.' schema: type: string enum: - asc - desc - name: team_name in: query required: false description: Filter by team name (partial match). schema: type: string responses: '200': $ref: '#/components/responses/TeamAPIKeyOwnersResponse' /v1/companies/{companyId}/teams/{teamId}/api_keys/with_usage: get: operationId: list-team-api-keys-with-usage-v1 tags: - Company Management summary: List team API keys with last usage time description: Returns all API keys of a specific team in the company, with last usage time. parameters: - name: companyId in: path required: true description: The UUID of the company. schema: type: string - name: teamId in: path required: true description: The UUID of the team. schema: type: string - name: limit in: query required: false description: Maximum number of items to return. schema: type: integer format: int32 minimum: 1 - name: offset in: query required: false description: Number of items to skip. schema: type: integer format: int32 minimum: 0 - name: name in: query required: false description: Filter by API key name (partial match). schema: type: string - name: sort_by_field in: query required: false description: 'Field to sort by: name, owner_name, last_used_at.' schema: type: string enum: - name - last_used_at - owner_name - name: sort_by_order in: query required: false description: 'Sort order: asc, desc.' schema: type: string enum: - asc - desc responses: '200': $ref: '#/components/responses/TeamAPIKeysWithUsageResponse' /v1/embeddings: post: operationId: post-embeddings-v1 summary: Create embeddings tags: - Embeddings description: Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EmbeddingsRequest' responses: '200': $ref: '#/components/responses/EmbeddingsResponse' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/files: get: operationId: get-files-v1 summary: List files tags: - Files description: Return the list of files that have been uploaded. parameters: - name: after in: query 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. required: false schema: type: string - name: limit in: query 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. required: false schema: type: integer format: uint32 minimum: 1 default: 10000 - name: order in: query description: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. required: false schema: type: string enum: - asc - desc default: desc - name: purpose in: query description: Only return files with the given purpose. required: false schema: $ref: '#/components/schemas/FilePurposeType' responses: '200': description: Successful response with list of files content: application/json: schema: $ref: '#/components/schemas/ListFilesResponse' '500': description: Server error. 4XX: description: Client error. post: operationId: post-files-v1 summary: Upload file tags: - Files description: Upload a file that other endpoints can reference, such as the request file consumed by the Batch API. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/UploadFileRequest' responses: '200': description: Successful response with file upload details content: application/json: schema: $ref: '#/components/schemas/FileResponse' '400': description: Invalid request data. '500': description: Server error. /v1/files/{file_id}: get: operationId: get-file-v1 summary: Get file tags: - Files description: Return the metadata for a single file by its ID. parameters: - name: file_id description: The ID of the file to use for this request. in: path required: true schema: type: string responses: '200': description: Successful response with file details content: application/json: schema: $ref: '#/components/schemas/FileResponse' '404': description: File not found. '500': description: Server error. delete: operationId: delete-file-v1 summary: Delete file tags: - Files description: Permanently delete a single file by its ID. parameters: - name: file_id in: path required: true schema: type: string responses: '200': description: Successful response with deletion status. content: application/json: schema: $ref: '#/components/schemas/DeletionStatusResponse' '404': description: File not found. '500': description: Server error. /v1/files/{file_id}/content: get: operationId: get-file-contents-v1 summary: Get file contents tags: - Files description: Download the raw contents of a single file by its ID. parameters: - name: file_id in: path required: true schema: type: string responses: '200': description: Successful response with file contents content: application/octet-stream: schema: type: string format: binary '404': description: File not found. '500': description: Server error. /v1/images/generations: post: operationId: post-images-generations-v1 summary: Create image tags: - Images description: Generate images from a text prompt. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ImagesGenerationsRequest' responses: '200': $ref: '#/components/responses/ImagesResponse' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/messages: post: operationId: createMessage tags: - Messages summary: Create a message (Anthropic-native) description: 'Anthropic-native Messages API. Accepts requests in Anthropic''s wire format and forwards them to the upstream Anthropic provider byte-for-byte, preserving native features such as `cache_control` for prompt caching. Use this endpoint when the client already speaks Anthropic — it avoids the OpenAI translation layer that silently strips `cache_control`. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateMessageRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MessagesResponse' text/event-stream: schema: $ref: '#/components/schemas/MessagesStreamEvent' /v1/models: get: operationId: get-user-models-v1 summary: List models description: List all models available to the user. tags: - Models responses: '200': $ref: '#/components/responses/UserModelsResponse' '404': description: User not found. /v1/management/models/{model}/fallbacks: get: operationId: get-model-fallbacks-v1 summary: Get fallbacks configuration for particular model description: Fallback configuration for a specific model. Fallbacks are tried in the order the model IDs are provided in the list. tags: - Models parameters: - name: model in: path required: true description: The ID of the model. schema: type: string responses: '200': description: Model fallbacks configuration found. content: application/json: schema: $ref: '#/components/schemas/ModelFallbacksConfiguration' '400': description: Invalid request. post: operationId: post-model-fallbacks-v1 summary: Add fallbacks configuration for particular model description: Add fallback configuration for a specific model. Fallbacks are tried in the order the model IDs are provided in the list. tags: - Models parameters: - name: model in: path required: true description: The ID of the model. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ModelFallbacksRequest' responses: '201': description: Model fallbacks configuration successfully created. content: application/json: schema: $ref: '#/components/schemas/ModelFallbacksConfiguration' '400': description: Invalid request or fallback configurations already associated with the model. '404': description: Model not found. delete: operationId: delete-model-fallbacks-v1 summary: Delete model fallbacks configuration description: Delete model fallbacks configuration tags: - Models parameters: - name: model in: path required: true description: The ID of the model. schema: type: string responses: '204': description: Model fallbacks configuration deleted successfully '400': description: Invalid request. patch: operationId: update-model-fallbacks-v1 summary: Update fallbacks configuration for particular model description: Update the fallback configuration for a specific model. Fallbacks are tried in the order the model IDs are provided in the list. tags: - Models parameters: - name: model in: path required: true description: The ID of the model. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ModelFallbacksRequest' responses: '200': description: Model fallbacks configuration successfully updated. content: application/json: schema: $ref: '#/components/schemas/ModelFallbacksConfiguration' '400': description: Invalid request. /v1/responses: post: operationId: createResponse tags: - Responses summary: Create a model response requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateResponseRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Response' text/event-stream: schema: $ref: '#/components/schemas/ResponseStreamEvent' description: Creates a model response. /v1/responses/{response_id}: get: operationId: getResponse tags: - Responses summary: Get a model response parameters: - in: path name: response_id required: true schema: type: string description: The ID of the response to retrieve. - in: query name: include schema: type: array items: $ref: '#/components/schemas/IncludeEnum' description: 'Additional fields to include in the response. See the `include` parameter for Response creation above for more information. ' - in: query name: stream schema: type: boolean 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). ' - in: query name: starting_after schema: type: integer description: 'The sequence number of the event after which to start streaming. ' - in: query name: include_obfuscation schema: 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. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Response' description: 'Retrieves a model response with the given ID. ' delete: operationId: deleteResponse tags: - Responses summary: Delete a model response parameters: - in: path name: response_id required: true schema: type: string description: The ID of the response to delete. responses: '200': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/Error' description: 'Deletes a model response with the given ID. ' /v1/responses/{response_id}/input_items: get: operationId: listInputItems tags: - Responses summary: List input items parameters: - in: path name: response_id required: true schema: type: string description: The ID of the response to retrieve input items for. - name: limit in: query description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. ' required: false schema: type: integer default: 20 - in: query name: order schema: type: string enum: - asc - desc description: 'The order to return the input items in. Default is `desc`. - `asc`: Return the input items in ascending order. - `desc`: Return the input items in descending order. ' - in: query name: after schema: type: string description: 'An item ID to list items after, used in pagination. ' - in: query name: include schema: type: array items: $ref: '#/components/schemas/IncludeEnum' description: 'Additional fields to include in the response. See the `include` parameter for Response creation above for more information. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ResponseItemList' description: Returns a list of input items for a given response. /v1/responses/{response_id}/cancel: post: operationId: cancelResponse tags: - Responses summary: Cancel a response parameters: - in: path name: response_id required: true schema: type: string description: The ID of the response to cancel. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/Error' description: "Cancels a model response with the given ID. Only responses created with\nthe `background`\ \ parameter set to `true` can be cancelled. \n" /v1/responses/compact: post: tags: - Responses summary: Compact a response description: Compact conversation operationId: CompactConversation parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CompactResponseMethodPublicBody' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CompactResponseMethodPublicBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/CompactResource' /v1/responses/input_tokens: post: tags: - Responses summary: Get input token counts description: Get input token counts operationId: GetInputTokenCounts parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/TokenCountsBody' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/TokenCountsBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/TokenCountsResource' /v1/storage: get: operationId: get-storage-files-v1 summary: List uploaded media files tags: - Storage description: List uploaded files. parameters: - name: after in: query 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. required: false schema: type: string - name: limit in: query 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. required: false schema: type: integer format: uint32 default: 10000 - name: order in: query description: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. required: false schema: type: string enum: - asc - desc default: desc - name: purpose in: query description: Only return files with the given purpose. required: false schema: $ref: '#/components/schemas/FilePurposeType' responses: '200': description: Successful response with list of files content: application/json: schema: $ref: '#/components/schemas/list_files_ListFilesResponse' '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. post: operationId: post-storage-files-v1 summary: Upload media file tags: - Storage description: Upload a media file for later use. requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/upload_file_UploadFileRequest' responses: '200': description: Successful response with file upload details content: application/json: schema: $ref: '#/components/schemas/file_FileResponse' '400': description: Invalid request data. '402': $ref: '#/components/responses/OutOfCredits' '500': description: Server error. /v1/storage/{file_id}: get: operationId: get-storage-file-v1 summary: Get storage file tags: - Storage description: Retrieve file details by ID. parameters: - name: file_id description: The ID of the file to use for this request. in: path required: true schema: type: string responses: '200': description: Successful response with file details content: application/json: schema: $ref: '#/components/schemas/file_FileResponse' '402': $ref: '#/components/responses/OutOfCredits' '404': description: File not found. '500': description: Server error. delete: operationId: delete-storage-file-v1 summary: Delete storage file tags: - Storage description: Delete a file by ID. parameters: - name: file_id in: path required: true schema: type: string responses: '200': description: Successful response with deletion status. content: application/json: schema: $ref: '#/components/schemas/deletion_status_DeletionStatusResponse' '402': $ref: '#/components/responses/OutOfCredits' '404': description: File not found. '500': description: Server error. /v1/storage/{file_id}/content: get: operationId: get-storage-file-contents-v1 summary: Get storage file contents tags: - Storage description: Download file contents by ID. parameters: - name: file_id in: path required: true schema: type: string responses: '200': description: Successful response with file contents content: application/octet-stream: schema: type: string format: binary '402': $ref: '#/components/responses/OutOfCredits' '404': description: File not found. '500': description: Server error. /v1/teams/{teamId}/api_keys: get: operationId: list-team-api-keys-v1 tags: - Team Management summary: List team API keys description: Return all API keys that belong to the team. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string responses: '200': description: List of team API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/APIKey' post: operationId: create-team-api-key-v1 tags: - Team Management summary: Create team API key description: Create a new API key for the team. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '201': $ref: '#/components/responses/TeamAPIKeyResponse' /v1/teams/{teamId}/api_keys/bulk: post: operationId: update-many-team-api-keys-v1 tags: - Team Management summary: Update many team API keys description: Update multiple team API keys in a single request. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyBulkUpdateRequest' responses: '200': description: Updated API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/APIKey' /v1/teams/{teamId}/api_keys/{keyId}: delete: operationId: delete-team-api-key-v1 tags: - Team Management summary: Delete team API key description: Permanently delete a team API key. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string - name: keyId in: path required: true description: The ID of the key. schema: type: string responses: '204': description: API key deleted successfully. '400': description: Bad request '404': description: Team/Key not found. patch: operationId: update-team-api-key-v1 tags: - Team Management summary: Update team API key description: Update a team API key. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string - name: keyId in: path required: true description: The ID of the key. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '200': $ref: '#/components/responses/TeamAPIKeyResponse' '400': description: Invalid request. '404': description: Team/Key not found. /v1/teams/{teamId}/api_keys/{keyId}/regenerate: patch: operationId: regenerate-team-api-key-v1 deprecated: true tags: - Team Management summary: Regenerate team API key description: Regenerate the value of a team API key. parameters: - name: teamId in: path required: true description: The ID of the team. schema: type: string - name: keyId in: path required: true description: The ID of the key. schema: type: string responses: '200': $ref: '#/components/responses/TeamAPIKeyResponse' '400': description: Invalid request. '404': description: Team/Key not found. /v1/apikey/rotate: patch: operationId: rotate-api-key-v1 tags: - Team Management - User Management summary: Rotate API key description: Rotates the API key used to authenticate this request. Returns a new key value. responses: '200': $ref: '#/components/responses/RotateAPIKeyResponse' '401': description: Unauthorized — request not authenticated via API key. '500': description: Internal server error. /v1/user/api_keys: get: operationId: list-user-api-keys-v1 tags: - User Management summary: List user API keys description: Return all API keys that belong to the current user. responses: '200': description: List of user API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/APIKey' post: operationId: create-user-api-key-v1 tags: - User Management summary: Create user API key description: Create a new API key for the current user. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '201': $ref: '#/components/responses/UserAPIKeyResponse' /v1/user/api_keys/bulk: post: operationId: update-many-user-api-keys-v1 tags: - User Management summary: Update many user API keys description: Update multiple user API keys in a single request. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyBulkUpdateRequest' responses: '200': description: Updated API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/APIKey' /v1/user/api_keys/{keyId}: delete: operationId: delete-user-api-key-v1 tags: - User Management summary: Delete user API key description: Permanently delete a user API key. parameters: - name: keyId in: path required: true description: The ID of the key. schema: type: string responses: '204': description: API key deleted successfully. '400': description: Bad request '404': description: User/Key not found. patch: operationId: update-user-api-key-v1 tags: - User Management summary: Update user API key description: Update a user API key. parameters: - name: keyId in: path required: true description: The ID of the key. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '200': $ref: '#/components/responses/UserAPIKeyResponse' '400': description: Invalid request. '404': description: User/Key not found. /v1/user/api_keys/{keyId}/regenerate: patch: operationId: regenerate-user-api-key-v1 deprecated: true tags: - User Management summary: Regenerate user API key description: Regenerate the value of a user API key. parameters: - name: keyId in: path required: true description: The ID of the key. schema: type: string responses: '200': $ref: '#/components/responses/UserAPIKeyResponse' '400': description: Invalid request. '404': description: User/Key not found. components: securitySchemes: bearerAuth: type: http scheme: bearer apiKeyHeader: type: apiKey in: header name: X-Api-Key description: 'Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: nexos-...` for a user key or `X-Api-Key: nexos-team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence.' schemas: AgentSortByField: type: string enum: - name - created_at AgentSortOrder: type: string enum: - asc - desc description: Sort order, must be used together with sort_by.field. Agent: description: Represents an AI agent. type: object properties: id: type: string description: Unique identifier. name: type: string description: Agent name. description: type: string description: Agent description. nullable: true instructions: type: string description: Agent instructions. model: type: string description: Model name. created_at: type: string format: date-time description: The time the agent was created. required: - id - created_at - name - model SortByField: type: string enum: - name - created_at SortOrder: type: string enum: - asc - desc description: Sort order, must be used together with sort_by.field. Assistant: description: Represents an AI assistant. type: object properties: id: type: string description: Unique identifier. name: type: string description: Assistant name. description: type: string description: Assistant description. nullable: true instructions: type: string description: Assistant instructions. model: type: string description: Model name. created_at: type: string format: date-time description: The time the assistant was created. required: - id - created_at - name - model SpeechRequest: type: object additionalProperties: false properties: model: type: string input: type: string description: The text to generate audio for. maxLength: 4096 voice: description: The voice to use when generating the audio. type: string enum: - alloy - echo - fable - onyx - nova - shimmer response_format: description: The format to output audio in. default: mp3 type: string enum: - mp3 - opus - aac - flac - wav - pcm speed: description: The speed of the generated audio. type: number default: 1 minimum: 0.25 maximum: 4 required: - model - input - voice TranscriptionRequest: type: object additionalProperties: false 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. ' type: string format: binary model: type: string language: 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) format will improve accuracy and latency. ' type: string prompt: description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting) should match the audio language. ' type: string response_format: description: 'The format of the transcript output. ' type: string enum: - json - text - srt - verbose_json - vtt default: json temperature: 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. ' type: number default: 0 timestamp_granularities[]: 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. ' type: array items: type: string enum: - word - segment default: - segment required: - file - model TranscriptionResponseJson: type: object description: Represents a transcription response returned by model, based on the provided input. properties: text: type: string description: The transcribed text. model: type: string description: The model used for generating transcription. TranscriptionResponseVerboseJson: type: object description: Represents a verbose json transcription response returned by model, based on the provided input. properties: language: type: string description: The language of the input audio. duration: type: string description: The duration of the input audio. text: type: string description: The transcribed text. words: type: array description: Extracted words and their corresponding timestamps. items: $ref: '#/components/schemas/TranscriptionWord' segments: type: array description: Segments of the transcribed text and their corresponding details. items: $ref: '#/components/schemas/TranscriptionSegment' model: type: string description: The model used for generating transcription. TranscriptionWord: type: object properties: word: type: string description: The text content of the word. start: type: number format: float description: Start time of the word in seconds. end: type: number format: float description: End time of the word in seconds. TranscriptionSegment: type: object properties: id: type: integer description: Unique identifier of the segment. seek: type: integer description: Seek offset of the segment. start: type: number format: float description: Start time of the segment in seconds. end: type: number format: float description: End time of the segment in seconds. text: type: string description: Text content of the segment. tokens: type: array items: type: 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. TranslationRequest: type: object additionalProperties: false 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. ' type: string format: binary model: type: string prompt: description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting) should be in English. ' type: string response_format: description: 'The format of the translated transcript output. ' type: string enum: - json - text - srt - verbose_json - vtt default: json temperature: 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. ' type: number default: 0 required: - file - model TranslationResponseJson: type: object description: Represents a translation response returned by model, based on the provided input. properties: text: type: string model: type: string description: The model used for generating translation. TranslationResponseVerboseJson: type: object description: Represents a verbose translation response returned by model, based on the provided input. properties: language: type: string description: The language of the output translation (always `english`). duration: type: string description: The duration of the input audio. text: type: string description: The translated text. segments: type: array description: Segments of the translated text and their corresponding details. items: $ref: '#/components/schemas/TranscriptionSegment' model: type: string description: The model used for generating translation. BatchesRequest: type: object properties: input_file_id: type: string description: 'The ID of an uploaded file that contains requests for the new batch. Your input file must be formatted as a JSONL file, and must be uploaded with the purpose set to "batch". The file can contain up to 50,000 requests, and can be up to 200 MB in size. ' endpoint: type: string description: 'The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. ' enum: - /v1/chat/completions - /v1/embeddings - /v1/completions completion_window: type: string description: 'The time frame within which the batch should be processed. Currently only "24h" is supported. ' enum: - 24h default: 24h metadata: type: object description: 'Optional custom metadata for the batch. This can be useful for tracking and organizing batches. ' additionalProperties: type: string required: - input_file_id - endpoint - completion_window Batch: type: object description: 'A batch object representing a collection of requests processed together. ' properties: id: type: string description: 'The unique identifier of the batch. ' object: type: string description: 'The object type, which is always "batch". ' enum: - batch endpoint: type: string description: 'The endpoint used for the batch requests. ' enum: - /v1/chat/completions - /v1/embeddings - /v1/completions errors: type: object description: 'Details about any errors encountered during batch processing. ' nullable: true properties: object: type: string enum: - list data: type: array items: type: object properties: code: type: string description: 'Error code indicating the type of error. ' message: type: string description: 'Human-readable error message. ' param: type: string nullable: true description: 'The parameter that caused the error, if applicable. ' line: type: integer nullable: true description: 'The line number in the input file where the error occurred. ' input_file_id: type: string description: 'The ID of the input file used for the batch. ' completion_window: type: string description: 'The time frame within which the batch should be processed. ' status: type: string description: 'The current status of the batch. ' enum: - validating - failed - in_progress - finalizing - completed - expired - cancelling - cancelled output_file_id: type: string nullable: true description: 'The ID of the file containing the outputs of the batch requests. This is only available when the batch status is "completed". ' error_file_id: type: string nullable: true description: 'The ID of the file containing the errors of the batch requests. This is only available when there are errors in the batch. ' created_at: type: integer description: 'The Unix timestamp (in seconds) for when the batch was created. ' in_progress_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch started processing. ' expires_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch will expire. ' finalizing_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch started finalizing. ' completed_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch was completed. ' failed_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch failed. ' expired_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch expired. ' cancelling_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch cancellation was initiated. ' cancelled_at: type: integer nullable: true description: 'The Unix timestamp (in seconds) for when the batch was cancelled. ' request_counts: type: object description: 'Statistics about the requests in the batch. ' properties: total: type: integer description: 'Total number of requests in the batch. ' completed: type: integer description: 'Number of requests that completed successfully. ' failed: type: integer description: 'Number of requests that failed. ' required: - total - completed - failed metadata: type: object nullable: true description: 'Set of 16 key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. ' additionalProperties: type: string required: - id - object - endpoint - input_file_id - completion_window - status - created_at - request_counts CompanyBudgetLimit: type: object properties: company_uuid: type: string description: The UUID of the company. target_type: type: string description: The target type of the budget limit. Only team or user are supported for new limits. enum: - company - team - user target_uuid: type: string description: The UUID of the target (team or user). limit_type: type: string description: The type of budget limit. enum: - general - public-api is_renewed: type: boolean description: Whether the budget limit is renewed periodically. value: type: number format: double description: The budget limit value. created_at: type: string format: date-time description: When the budget limit was created. updated_at: type: string format: date-time description: When the budget limit was last updated. required: - company_uuid - target_type - target_uuid - limit_type - is_renewed - created_at - updated_at UpsertCompanyBudgetLimitRequest: type: object properties: target_type: type: string description: The target type of the budget limit (only team or user are supported). enum: - team - user target_uuid: type: string description: The UUID of the target (team or user). Empty string for default budget limit_type: type: string description: The type of budget limit. enum: - general - public-api is_renewed: type: boolean description: Whether the budget limit is renewed periodically. value: type: integer format: int64 description: The budget limit value. nullable: true required: - target_type - target_uuid - limit_type - is_renewed - value DeleteCompanyBudgetLimitRequest: type: object properties: target_type: type: string description: The target type of the budget limit (only team or user are supported). enum: - team - user target_uuid: type: string description: The UUID of the target (team or user). limit_type: type: string description: The type of budget limit. enum: - general - public-api required: - target_type - limit_type - target_uuid BulkUpsertCompanyBudgetLimitRequest: type: object properties: items: type: array items: $ref: '#/components/schemas/BulkUpsertCompanyBudgetLimitItem' required: - items BulkUpsertCompanyBudgetLimitItem: type: object properties: target_type: type: string description: The target type of the budget limit (only team or user are supported). enum: - team - user target_uuid: type: string description: The UUID of the target (team or user). Empty string for default budget. limit_type: type: string description: The type of budget limit. enum: - general - public-api is_renewed: type: boolean description: Whether the budget limit is renewed periodically. value: type: integer format: int64 description: The budget limit value. Ignored when remove is true. remove: type: boolean description: When true, the matching row is deleted instead of upserted. required: - target_type - target_uuid - limit_type - is_renewed ChatCompletionsRequest: type: object properties: messages: description: 'A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. ' type: array minItems: 1 items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessage' model: type: string description: Model name, UUID, or agent UUID. store: type: boolean description: 'Whether or not to store the output of this chat completion request ' metadata: type: object description: 'Developer-defined tags and values used for filtering completions in the dashboard. ' additionalProperties: type: string frequency_penalty: type: number default: 0 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. ' logit_bias: type: object additionalProperties: type: integer 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. ' logprobs: 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`. type: boolean top_logprobs: description: An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. type: integer minimum: 0 maximum: 20 max_tokens: description: 'The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o1 series models. ' type: integer nullable: true deprecated: true max_completion_tokens: description: 'An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. ' type: integer nullable: true n: type: integer minimum: 1 maximum: 128 default: 1 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. modalities: $ref: '#/components/schemas/ChatCompletionModalities' prediction: description: 'Configuration for a Predicted Output, 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. ' oneOf: - $ref: '#/components/schemas/PredictionContent' audio: type: object description: 'Parameters for audio output. Required when audio output is requested with `modalities: ["audio"]`. ' required: - voice - format properties: voice: type: string enum: - alloy - ash - ballad - coral - echo - sage - shimmer - verse description: 'The voice the model uses to respond. Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`. ' format: type: string enum: - wav - mp3 - flac - opus - pcm16 description: 'Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. ' presence_penalty: type: number default: 0 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. ' response_format: description: 'An object specifying the format that the model must output. Compatible with GPT-4o, GPT-4o mini, GPT-4 Turbo and all GPT-3.5 Turbo models newer than `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. 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. ' oneOf: - $ref: '#/components/schemas/ResponseFormatText' - $ref: '#/components/schemas/ResponseFormatJsonObject' - $ref: '#/components/schemas/ResponseFormatJsonSchema' seed: type: integer minimum: -9223372036854776000 maximum: 9223372036854776000 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. ' service_tier: description: 'Specifies the processing type used for serving the request. If set to ''default'' or ''auto'', then the request will be processed with the standard pricing and performance for the selected model. If set to ''flex'' or ''priority'', 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. ' type: string enum: - auto - default - flex - scale - priority default: auto stop: description: 'Up to 4 sequences where the API will stop generating further tokens. ' oneOf: - type: string - type: array minItems: 1 maxItems: 4 items: type: string stream: description: 'If set, partial message deltas will be sent, like in ChatGPT. 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. ' type: boolean stream_options: $ref: '#/components/schemas/ChatCompletionStreamOptions' temperature: type: number minimum: 0 maximum: 2 default: 1 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. ' top_p: type: number minimum: 0 maximum: 1 default: 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. ' tools: type: array description: 'A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. ' items: $ref: '#/components/schemas/ChatCompletionTool' tool_choice: $ref: '#/components/schemas/ChatCompletionToolChoiceOption' parallel_tool_calls: $ref: '#/components/schemas/ParallelToolCalls' function_call: deprecated: true 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. ' oneOf: - type: string description: '`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. ' enum: - none - auto - $ref: '#/components/schemas/ChatCompletionFunctionCallOption' functions: deprecated: true description: 'Deprecated in favor of `tools`. A list of functions the model may generate JSON inputs for. ' type: array minItems: 1 maxItems: 128 items: $ref: '#/components/schemas/ChatCompletionFunctions' thinking: type: object properties: type: type: string description: The type of thinking configuration budget_tokens: type: integer description: The token budget allocation for thinking operations reasoning_effort: type: string description: Reasoning effort for models that support reasoning. enum: - none - minimal - low - medium - high - xhigh - max verbosity: type: string description: Constrains the verbosity of the model's response. enum: - low - medium - high required: - model - messages chat_completions_messages_ChatCompletionRequestMessage: oneOf: - $ref: '#/components/schemas/ChatCompletionRequestDeveloperMessage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestSystemMessage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestUserMessage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestAssistantMessage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestToolMessage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestFunctionMessage' ChatCompletionRequestDeveloperMessage: type: object title: Developer message 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. ' properties: content: description: The contents of the developer message. oneOf: - type: string description: The contents of the developer message. title: Text content - type: array description: An array of content parts with a defined type. For developer messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartText' minItems: 1 role: type: string enum: - developer description: The role of the messages author, in this case `developer`. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role chat_completions_messages_ChatCompletionRequestMessageContentPartText: type: object title: Text content part description: 'Learn about [text inputs](/docs/guides/text-generation). ' properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. required: - type - text chat_completions_messages_ChatCompletionRequestSystemMessage: type: object title: System message 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. ' properties: content: description: The contents of the system message. oneOf: - type: string description: The contents of the system message. title: Text content - type: array description: An array of content parts with a defined type. For system messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestSystemMessageContentPart' minItems: 1 role: type: string enum: - system description: The role of the messages author, in this case `system`. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role chat_completions_messages_ChatCompletionRequestSystemMessageContentPart: oneOf: - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartText' chat_completions_messages_ChatCompletionRequestUserMessage: type: object title: User message description: 'Messages sent by an end user, containing prompts or additional context information. ' properties: content: description: 'The contents of the user message. ' oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text, image, or audio inputs. title: Array of content parts items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestUserMessageContentPart' minItems: 1 role: type: string enum: - user description: The role of the messages author, in this case `user`. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role chat_completions_messages_ChatCompletionRequestUserMessageContentPart: oneOf: - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartText' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartImage' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartAudio' chat_completions_messages_ChatCompletionRequestMessageContentPartImage: type: object title: Image content part description: 'Learn about [image inputs](/docs/guides/vision). ' properties: type: type: string enum: - image_url description: The type of the content part. image_url: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. format: uri detail: type: string description: Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding). enum: - auto - low - high default: auto required: - url required: - type - image_url chat_completions_messages_ChatCompletionRequestMessageContentPartAudio: type: object title: Audio content part description: 'Learn about [audio inputs](/docs/guides/audio). ' properties: type: type: string enum: - input_audio description: The type of the content part. Always `input_audio`. input_audio: type: object properties: data: type: string description: Base64 encoded audio data. format: type: string enum: - wav - mp3 description: 'The format of the encoded audio data. Currently supports "wav" and "mp3". ' required: - data - format required: - type - input_audio chat_completions_messages_ChatCompletionRequestAssistantMessage: type: object title: Assistant message description: 'Messages sent by the model in response to user messages. ' properties: content: nullable: true oneOf: - type: string description: The contents of the assistant message. title: Text content - type: array description: An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`. title: Array of content parts items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestAssistantMessageContentPart' minItems: 1 description: 'The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. ' refusal: nullable: true type: string description: The refusal message by the assistant. role: type: string enum: - assistant description: The role of the messages author, in this case `assistant`. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. audio: type: object nullable: true description: "Data about a previous audio response from the model. \n[Learn more](/docs/guides/audio).\n" required: - id properties: id: type: string description: 'Unique identifier for a previous audio response from the model. ' tool_calls: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionMessageToolCalls' function_call: type: object deprecated: true description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. nullable: true properties: arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. name: type: string description: The name of the function to call. required: - arguments - name required: - role chat_completions_messages_ChatCompletionRequestAssistantMessageContentPart: oneOf: - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartText' - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartRefusal' chat_completions_messages_ChatCompletionRequestMessageContentPartRefusal: type: object title: Refusal content part properties: type: type: string enum: - refusal description: The type of the content part. refusal: type: string description: The refusal message generated by the model. required: - type - refusal chat_completions_messages_ChatCompletionMessageToolCalls: type: array description: The tool calls generated by the model, such as function calls. items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionMessageToolCall' chat_completions_messages_ChatCompletionMessageToolCall: type: object 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. function: type: object description: The function that the model called. 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. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments required: - id - type - function chat_completions_messages_ChatCompletionRequestToolMessage: type: object title: Tool message properties: role: type: string enum: - tool description: The role of the messages author, in this case `tool`. content: oneOf: - type: string description: The contents of the tool message. title: Text content - type: array description: An array of content parts with a defined type. For tool messages, only type `text` is supported. title: Array of content parts items: $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestToolMessageContentPart' minItems: 1 description: The contents of the tool message. tool_call_id: type: string description: Tool call that this message is responding to. required: - role - content - tool_call_id chat_completions_messages_ChatCompletionRequestToolMessageContentPart: oneOf: - $ref: '#/components/schemas/chat_completions_messages_ChatCompletionRequestMessageContentPartText' chat_completions_messages_ChatCompletionRequestFunctionMessage: type: object title: Function message deprecated: true properties: role: type: string enum: - function description: The role of the messages author, in this case `function`. content: nullable: true type: string description: The contents of the function message. name: type: string description: The name of the function to call. required: - role - content - name ChatCompletionModalities: type: array description: 'Output types that you would like the model to generate for this request. Most models are capable of generating text, which is the default: `["text"]` To request that this model generate both text and audio responses, you can use: `["text", "audio"]` ' items: type: string enum: - text - audio PredictionContent: type: object title: Static Content description: 'Static predicted output content, such as the content of a text file that is being regenerated. ' 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`. ' content: 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. ' oneOf: - type: string title: Text content description: 'The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes. ' - type: array description: An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text inputs. title: Array of content parts items: $ref: '#/components/schemas/ChatCompletionRequestMessageContentPartText' minItems: 1 ChatCompletionRequestMessageContentPartText: type: object title: Text content part properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. required: - type - text ResponseFormatText: type: object properties: type: type: string description: 'The type of response format being defined: `text`' enum: - text required: - type ResponseFormatJsonObject: type: object properties: type: type: string description: 'The type of response format being defined: `json_object`' enum: - json_object required: - type ResponseFormatJsonSchema: type: object properties: type: type: string description: 'The type of response format being defined: `json_schema`' enum: - json_schema json_schema: type: object properties: description: 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: 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/ResponseFormatJsonSchemaSchema' strict: type: boolean nullable: true default: false description: Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs). required: - type - name required: - type - json_schema ResponseFormatJsonSchemaSchema: type: object description: The schema for the response format, described as a JSON Schema object. additionalProperties: true ChatCompletionStreamOptions: description: 'Options for streaming response. Only set this when you set `stream: true`. ' 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 ' ChatCompletionTool: type: object properties: type: type: string enum: - function - web_search - rag - tika_ocr description: The type of the tool. Supports `function`, `web_search`, `rag` and `tika_ocr`. function: $ref: '#/components/schemas/FunctionObject' web_search: $ref: '#/components/schemas/ChatCompletionWebSearch' rag: $ref: '#/components/schemas/ChatCompletionRAG' tika_ocr: $ref: '#/components/schemas/ChatCompletionTikaOCR' required: - type FunctionObject: type: object 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/FunctionParameters' strict: type: boolean nullable: true default: false description: Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. required: - name FunctionParameters: type: object description: 'The parameters the functions accepts, described as a JSON Schema object. Omitting `parameters` defines a function with an empty parameter list.' additionalProperties: true ChatCompletionWebSearch: type: object description: The web search that the model called. properties: search_context_size: type: string description: High level guidance for the amount of context window space to use for the search. enum: - low - medium - high user_location: $ref: '#/components/schemas/UserLocation' mcp: $ref: '#/components/schemas/WebSearchMCP' UserLocation: type: object required: - type properties: type: type: string description: The type of location approximation. enum: - approximate city: type: string description: The city to use for the location approximation. country: type: string description: The two-letter ISO country code of the user. region: type: string description: Free text input for the region of the user. timezone: type: string description: The IANA timezone of the user. WebSearchMCP: type: object description: Custom MCP web_search required: - type - options` properties: type: type: string description: The type of the web search. enum: - url - query options: oneOf: - $ref: '#/components/schemas/QuerySearch' - $ref: '#/components/schemas/URLSearch' QuerySearch: type: object required: - tool - query properties: tool: type: string description: The type of tool used for web search. enum: - google_search - bing_search - amazon_search query: type: string description: The query to search for. geo_location: type: string description: The geographic location to use for the search. parse: type: boolean description: Whether to parse the search results. default: false URLSearch: type: object required: - tool - url properties: tool: type: string description: The type of the web search. enum: - universal url: type: string description: The URL to search for. geo_location: type: string description: The geographic location to use for the search. parse: type: boolean description: Whether to parse the search results. default: false ChatCompletionRAG: type: object description: RAG tool call properties: mcp: $ref: '#/components/schemas/RagMCP' RagMCP: type: object description: RAG MCP tool call required: - collection_uuid properties: collection_uuid: type: string description: The UUID of the collection to search. query: type: string description: The query to search for. threshold: type: number format: float description: The threshold for the search results. top_n: type: integer description: The number of top results to return. model_uuid: type: string description: The UUID of the model to use for the search. ChatCompletionTikaOCR: type: object description: Tika OCR that the model called. properties: file_id: type: string required: - file_id ChatCompletionToolChoiceOption: 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. ' oneOf: - type: string description: '`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. ' enum: - none - auto - required - $ref: '#/components/schemas/ChatCompletionNamedToolChoice' ChatCompletionNamedToolChoice: type: object description: Specifies a tool the model should use. Use to force the model to call a specific function. properties: type: type: string enum: - function description: The type of the tool. Currently, only `function` is supported. function: type: object properties: name: type: string description: The name of the function to call. required: - name required: - type - function ParallelToolCalls: description: Whether to enable parallel function calling during tool use. type: boolean default: true ChatCompletionFunctionCallOption: type: object description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. ' properties: name: type: string description: The name of the function to call. required: - name ChatCompletionFunctions: type: object 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/FunctionParameters' required: - name ChatCompletionFinishReason: type: string description: 'The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. ' enum: - stop - length - tool_calls - content_filter - function_call ChatCompletionResponseMessage: type: object description: A chat completion message generated by the model. properties: content: type: string description: The contents of the message. nullable: true refusal: type: string description: The refusal message generated by the model. nullable: true tool_calls: $ref: '#/components/schemas/ChatCompletionMessageToolCalls' role: type: string enum: - assistant description: The role of the author of this message. function_call: type: object deprecated: true description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. properties: arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. name: type: string description: The name of the function to call. required: - name - arguments audio: type: object nullable: true description: 'If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](/docs/guides/audio). ' required: - id - expires_at - data - transcript properties: id: type: string description: Unique identifier for this audio response. expires_at: type: integer description: 'The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations. ' data: type: string description: 'Base64 encoded audio bytes generated by the model, in the format specified in the request. ' transcript: type: string description: Transcript of the audio generated by the model. annotations: type: array description: Annotations for the message, when applicable, as when using the web search tool. items: $ref: '#/components/schemas/Annotation' required: - role - content - refusal ChatCompletionMessageToolCalls: type: array description: The tool calls generated by the model, such as function calls. items: $ref: '#/components/schemas/ChatCompletionMessageToolCall' ChatCompletionMessageToolCall: type: object 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. function: type: object description: The function that the model called. 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. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments required: - id - type - function Annotation: type: object properties: type: type: string description: The type of the URL citation. Always url_citation. url_citation: $ref: '#/components/schemas/URLCitation' URLCitation: type: object description: A URL citation when using web search. properties: end_index: type: integer description: The index of the last character of the URL citation in the message. start_index: type: integer description: The index of the first character of the URL citation in the message. title: type: string description: The title of the web resource. url: type: string description: The URL of the web resource. ChatCompletionTokenLogprob: type: object properties: token: description: The token. type: string logprob: 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. ' type: number bytes: description: 'A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. ' type: array items: type: integer nullable: true top_logprobs: description: 'List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. ' type: array items: type: object properties: token: description: The token. type: string logprob: 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. ' type: number bytes: description: 'A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. ' type: array items: type: integer nullable: true required: - token - logprob - bytes required: - token - logprob - bytes - top_logprobs ChatCompletionServiceTier: description: 'The service tier used for processing the request. This field is only included if the `service_tier` parameter is specified in the request. The value may differ from the `service_tier` parameter sent in the request. For example, if ''auto'' is specified, the response will return ''default'' as they are equivalent. ' type: string enum: - auto - default - flex - scale - priority nullable: true ChatCompletionObject: type: string description: The object type, which is always `chat.completion`. enum: - chat.completion CompletionUsage: type: object description: Usage statistics for the completion request. properties: completion_tokens: type: integer description: Number of tokens in the generated completion. prompt_tokens: type: integer description: Number of tokens in the prompt. total_tokens: type: integer description: Total number of tokens used in the request (prompt + completion). nexos_credits_cost: type: number format: double description: Cost of the request in nexos credits. completion_tokens_details: type: object description: Breakdown of tokens used in a completion. properties: accepted_prediction_tokens: type: integer description: 'When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion. ' audio_tokens: type: integer description: Audio input tokens generated by the model. reasoning_tokens: type: integer description: Tokens generated by the model for reasoning. rejected_prediction_tokens: type: integer description: 'When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits. ' prompt_tokens_details: type: object description: Breakdown of tokens used in the prompt. properties: audio_tokens: type: integer description: Audio input tokens present in the prompt. cached_tokens: type: integer description: Cached tokens present in the prompt. required: - prompt_tokens - completion_tokens - total_tokens CompanyAPIKey: type: object properties: uuid: type: string description: UUID of the API key. name: type: string description: Name of the API key. api_key: type: string description: Masked API key value. key_owner: type: string description: Display name of the key owner (user name or team name). owner_uuid: type: string description: UUID of the key owner (user UUID or team UUID). last_used_at: type: string format: date-time description: Last time the key was used. status: type: string description: Status of the API key. enum: - active - disabled - removed - user_deleted - team_deleted - budget_exceeded type: type: string description: Type of the API key owner. enum: - user - team budget_used: type: number format: float description: Current budget used for the owner. budget_limit: type: number format: float description: Budget limit set for the owner, if any. required: - uuid - name - api_key - key_owner - status - type - owner_uuid UserAPIKeyOwner: type: object properties: owner_uuid: type: string description: UUID of the owner (user). owner_name: type: string description: Display name of the owner. key_count: type: integer format: int64 description: Number of API keys belonging to this owner. status: type: string description: Dynamic status of the API key owner. enum: - active - disabled - removed - user_deleted - team_deleted - budget_exceeded budget_used: type: number format: float description: Current budget used for the user. budget_limit: type: number format: float description: Budget limit set for the user, if any. required: - owner_uuid - owner_name - key_count - status APIKeyWithOwner: allOf: - $ref: '#/components/schemas/APIKey' - type: object properties: owner_uuid: type: string description: UUID of the owner (user or team). owner_name: type: string description: Display name of the owner. last_used_at: type: string format: date-time description: The time the key was last used. Null if the key has never been used. removed: type: boolean description: Whether the API key owner has been removed. status: type: string description: Dynamic status of the API key. enum: - active - disabled - removed - user_deleted - team_deleted - budget_exceeded budget_used: type: number format: float description: Current budget used for the key owner. budget_limit: type: number format: float description: Budget limit set for the user, if any. required: - owner_uuid - owner_name - status APIKey: type: object properties: api_key: type: string description: API Key for use with completions API id: type: string description: Unique identifier for the API key name: type: string description: Display name for the API key enabled: type: boolean description: Whether the API key is enabled. removed: type: boolean description: Whether the API key has been soft-deleted created_at: type: string format: date-time description: The time the key was created. updated_at: type: string format: date-time description: The time the key was last updated. last_used_at: type: string format: date-time description: The time the key was last used. expiration_date: type: string format: date-time description: The date when the key expires. Null if the key does not expire. required: - id - api_key - name - enabled - removed TeamAPIKeyOwner: type: object properties: owners: type: array items: $ref: '#/components/schemas/APIKeyOwnerInfo' description: List of team members associated with the key group. key_count: type: integer format: int64 description: Number of API keys belonging to this team. team_uuid: type: string description: UUID of the team. team_name: type: string description: Name of the team. status: type: string description: Dynamic status of the API key owner. enum: - active - disabled - removed - user_deleted - team_deleted - budget_exceeded budget_used: type: number format: float description: Current budget used for the team. budget_limit: type: number format: float description: Budget limit set for the team, if any. required: - owners - key_count - status APIKeyOwnerInfo: type: object properties: owner_uuid: type: string description: UUID of the owner (user). owner_name: type: string description: Display name of the owner. required: - owner_uuid - owner_name EmbeddingsRequest: type: object properties: model: type: string input: description: Input text to get embeddings for. oneOf: - type: string - type: array items: type: string - type: array items: type: integer - type: array items: type: array items: type: integer encoding_format: type: string description: The format to return the embeddings in. Can be either float or base64. enum: - float - base64 default: float dimensions: type: integer description: The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. minimum: 1 required: - model - prompt FilePurposeType: type: string description: The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API. enum: - batch ListFilesResponse: type: object description: A list of uploaded files. properties: data: type: array items: $ref: '#/components/schemas/FileResponse' object: type: string description: The object type, which is always list. enum: - list hasMore: type: boolean description: Indicates if there are more items to be fetched. firstId: type: string description: The ID of the first item in the list. lastId: type: string description: The ID of the last item in the list. required: - data - object FileResponse: type: object description: A document that has been uploaded and can be referenced by other endpoints. properties: bytes: type: integer description: The size of the file, in bytes. created_at: type: integer description: The Unix timestamp (in seconds) for when the file was created. expires_at: type: integer description: The Unix timestamp (in seconds) for when the file will expire. filename: type: string description: The name of the file. id: type: string description: The file identifier, which can be referenced in the API endpoints. object: type: string description: The object type, which is always "file". enum: - file purpose: $ref: '#/components/schemas/FilePurposeType' status: type: string description: Deprecated. The current status of the file. deprecated: true enum: - uploaded - processed - error UploadFileRequest: type: object additionalProperties: false properties: file: description: 'The File object (not file name) to be uploaded. ' type: string format: binary purpose: $ref: '#/components/schemas/FilePurposeType' required: - file - purpose DeletionStatusResponse: type: object description: The status of a file deletion. properties: id: type: string description: The file identifier. object: type: string description: The object type, which is always file. enum: - file deleted: type: boolean description: Indicates whether the file has been deleted. required: - id - object - deleted ImagesGenerationsRequest: type: object additionalProperties: false properties: prompt: description: A text description of the desired image(s). type: string model: type: string n: type: integer minimum: 1 maximum: 10 nullable: true description: The number of images to generate. Must be between 1 and 10. quality: description: The quality of the generated images. type: string enum: - standard - hd default: standard response_format: description: The format of the generated images. type: string enum: - url - b64_json default: url nullable: true size: description: The size of the generated images. type: string enum: - 256x256 - 512x512 - 1024x1024 - 1792x1024 - 1024x1792 nullable: true style: description: The style of the generated images. type: string enum: - vivid - natural default: vivid nullable: true required: - prompt - model CreateMessageRequest: type: object description: 'Anthropic-native Messages API request body. Forwarded byte-for-byte to the upstream provider — `cache_control` markers are preserved exactly where the client placed them (system blocks, message content blocks, tool definitions, top-level). ' properties: model: type: string description: Model identifier or alias resolved against the company's configured models. Must resolve to an Anthropic-provider model. messages: type: array items: $ref: '#/components/schemas/InputMessage' system: description: System prompt as a single string or as an array of text blocks (each may carry `cache_control`). oneOf: - type: string - type: array items: $ref: '#/components/schemas/SystemBlock' max_tokens: type: integer minimum: 0 description: Maximum output tokens. Set to `0` to warm the prompt cache without generating output. temperature: type: number minimum: 0 maximum: 1 nullable: true top_p: type: number nullable: true top_k: type: integer nullable: true stop_sequences: type: array nullable: true items: type: string stream: type: boolean default: false nullable: true metadata: $ref: '#/components/schemas/Metadata' nullable: true tools: type: array nullable: true items: $ref: '#/components/schemas/Tool' tool_choice: $ref: '#/components/schemas/ToolChoice' nullable: true cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true thinking: $ref: '#/components/schemas/ThinkingConfig' nullable: true service_tier: type: string enum: - auto - standard_only nullable: true container: type: string nullable: true required: - model - messages - max_tokens InputMessage: type: object description: A single input message in the `messages` array. properties: role: type: string enum: - user - assistant content: description: Either a plain string or an array of content blocks. oneOf: - type: string - type: array items: $ref: '#/components/schemas/ContentBlock' required: - role - content ContentBlock: description: 'A content block within a message''s `content` array. Discriminator is `type`. Strict-typed concrete subtypes cover the full Anthropic Messages API surface; `cache_control` is forwarded byte-for-byte where present. ' oneOf: - $ref: '#/components/schemas/TextBlock' - $ref: '#/components/schemas/ImageBlock' - $ref: '#/components/schemas/DocumentBlock' - $ref: '#/components/schemas/ToolUseBlock' - $ref: '#/components/schemas/ToolResultBlock' - $ref: '#/components/schemas/ThinkingBlock' - $ref: '#/components/schemas/RedactedThinkingBlock' - $ref: '#/components/schemas/ServerToolUseBlock' - $ref: '#/components/schemas/WebSearchToolResultBlock' - $ref: '#/components/schemas/SearchResultBlock' discriminator: propertyName: type mapping: text: '#/components/schemas/TextBlock' image: '#/components/schemas/ImageBlock' document: '#/components/schemas/DocumentBlock' tool_use: '#/components/schemas/ToolUseBlock' tool_result: '#/components/schemas/ToolResultBlock' thinking: '#/components/schemas/ThinkingBlock' redacted_thinking: '#/components/schemas/RedactedThinkingBlock' server_tool_use: '#/components/schemas/ServerToolUseBlock' web_search_tool_result: '#/components/schemas/WebSearchToolResultBlock' search_result: '#/components/schemas/SearchResultBlock' TextBlock: type: object properties: type: type: string enum: - text text: type: string cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true citations: type: array nullable: true items: type: object properties: type: type: string cited_text: type: string document_index: type: integer document_title: type: string nullable: true start_char_index: type: integer end_char_index: type: integer start_page_number: type: integer end_page_number: type: integer start_block_index: type: integer end_block_index: type: integer required: - type required: - type - text CacheControlEphemeral: type: object description: 'Marks a caching breakpoint for prompt caching. Attach it to any cacheable element — system text blocks, message content blocks, tool definitions, `tool_use`, `tool_result`, `search_result`, or `document` blocks. A request may carry up to four such breakpoints. When supplied at the top level, it is automatically applied to the last cacheable block. ' properties: type: type: string enum: - ephemeral ttl: type: string description: How long the cached prefix stays valid. Omitting it falls back to `5m`; `1h` works without any beta header. enum: - 5m - 1h required: - type ImageBlock: type: object properties: type: type: string enum: - image source: $ref: '#/components/schemas/ImageSource' cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - source ImageSource: oneOf: - $ref: '#/components/schemas/ImageSourceBase64' - $ref: '#/components/schemas/ImageSourceURL' ImageSourceBase64: type: object properties: type: type: string enum: - base64 media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp data: type: string description: Base64-encoded image bytes. required: - type - media_type - data ImageSourceURL: type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url DocumentBlock: type: object properties: type: type: string enum: - document source: $ref: '#/components/schemas/DocumentSource' title: type: string nullable: true context: type: string nullable: true citations: $ref: '#/components/schemas/CitationsConfig' nullable: true cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - source DocumentSource: oneOf: - $ref: '#/components/schemas/DocumentSourceBase64' - $ref: '#/components/schemas/DocumentSourceURL' - $ref: '#/components/schemas/DocumentSourceText' - $ref: '#/components/schemas/DocumentSourceContent' DocumentSourceBase64: type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf data: type: string required: - type - media_type - data DocumentSourceURL: type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url DocumentSourceText: type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data DocumentSourceContent: type: object properties: type: type: string enum: - content content: type: array items: oneOf: - $ref: '#/components/schemas/TextBlock' - $ref: '#/components/schemas/ImageBlock' required: - type - content CitationsConfig: type: object properties: enabled: type: boolean required: - enabled ToolUseBlock: type: object properties: type: type: string enum: - tool_use id: type: string name: type: string input: type: object description: Arguments passed to the tool, matching the input schema the client declared for it. cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - id - name - input ToolResultBlock: type: object properties: type: type: string enum: - tool_result tool_use_id: type: string content: description: Either a plain string or an array of text/image content blocks. oneOf: - type: string - type: array items: oneOf: - $ref: '#/components/schemas/TextBlock' - $ref: '#/components/schemas/ImageBlock' is_error: type: boolean nullable: true cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - tool_use_id ThinkingBlock: type: object properties: type: type: string enum: - thinking thinking: type: string signature: type: string cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - thinking - signature RedactedThinkingBlock: type: object properties: type: type: string enum: - redacted_thinking data: type: string required: - type - data ServerToolUseBlock: type: object description: A built-in tool call (such as `web_search` or `code_execution`) that the provider runs on its own side. properties: type: type: string enum: - server_tool_use id: type: string name: type: string input: type: object cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - id - name - input WebSearchToolResultBlock: type: object properties: type: type: string enum: - web_search_tool_result tool_use_id: type: string content: description: Either an array of search results or an error block. oneOf: - type: array items: type: object properties: type: type: string enum: - web_search_result url: type: string title: type: string encrypted_content: type: string page_age: type: string nullable: true required: - type - url - title - encrypted_content - type: object properties: type: type: string enum: - web_search_tool_result_error error_code: type: string required: - type - error_code cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - tool_use_id - content SearchResultBlock: type: object properties: type: type: string enum: - search_result source: type: string nullable: true title: type: string nullable: true content: type: array items: $ref: '#/components/schemas/TextBlock' citations: $ref: '#/components/schemas/CitationsConfig' nullable: true cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - content SystemBlock: type: object description: A system prompt content block. Supports `cache_control` for caching the system prefix. properties: type: type: string enum: - text text: type: string cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - text Metadata: type: object description: Optional request metadata passed through to the provider. The `user_id` field helps the provider associate the request with an end user. properties: user_id: type: string nullable: true Tool: description: Tool definition. Either a custom tool (function with input_schema) or a built-in server tool (typed by versioned `type`). oneOf: - $ref: '#/components/schemas/CustomTool' - $ref: '#/components/schemas/ServerTool' CustomTool: type: object description: A function tool that the client defines and implements. properties: name: type: string description: type: string input_schema: type: object description: A JSON Schema object that defines the shape of the tool's input arguments. type: type: string enum: - custom description: Optional type marker. Leave it out for legacy custom tools, or set it to `custom` when you need to be explicit. cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - name - input_schema ServerTool: type: object description: A provider-hosted built-in tool, identified by its versioned type (for example `web_search_20250305`, `code_execution_20250825`, `bash_20250124`, `text_editor_20250124`, or `memory_20250818`). properties: type: type: string name: type: string cache_control: $ref: '#/components/schemas/CacheControlEphemeral' nullable: true required: - type - name ToolChoice: description: Controls how the model selects tools. oneOf: - $ref: '#/components/schemas/ToolChoiceAuto' - $ref: '#/components/schemas/ToolChoiceAny' - $ref: '#/components/schemas/ToolChoiceTool' - $ref: '#/components/schemas/ToolChoiceNone' discriminator: propertyName: type mapping: auto: '#/components/schemas/ToolChoiceAuto' any: '#/components/schemas/ToolChoiceAny' tool: '#/components/schemas/ToolChoiceTool' none: '#/components/schemas/ToolChoiceNone' ToolChoiceAuto: type: object properties: type: type: string enum: - auto disable_parallel_tool_use: type: boolean nullable: true required: - type ToolChoiceAny: type: object properties: type: type: string enum: - any disable_parallel_tool_use: type: boolean nullable: true required: - type ToolChoiceTool: type: object properties: type: type: string enum: - tool name: type: string disable_parallel_tool_use: type: boolean nullable: true required: - type - name ToolChoiceNone: type: object properties: type: type: string enum: - none required: - type ThinkingConfig: description: Extended thinking configuration. oneOf: - $ref: '#/components/schemas/EnabledThinkingConfig' - $ref: '#/components/schemas/DisabledThinkingConfig' discriminator: propertyName: type mapping: enabled: '#/components/schemas/EnabledThinkingConfig' disabled: '#/components/schemas/DisabledThinkingConfig' EnabledThinkingConfig: type: object properties: type: type: string enum: - enabled budget_tokens: type: integer minimum: 1024 required: - type - budget_tokens DisabledThinkingConfig: type: object properties: type: type: string enum: - disabled required: - type MessagesResponse: type: object description: Anthropic-native non-streaming Messages API response. properties: id: type: string type: type: string enum: - message role: type: string enum: - assistant model: type: string content: type: array items: $ref: '#/components/schemas/ContentBlock' stop_reason: type: string nullable: true enum: - end_turn - max_tokens - stop_sequence - tool_use - pause_turn - refusal stop_sequence: type: string nullable: true usage: $ref: '#/components/schemas/Usage' container: $ref: '#/components/schemas/Container' nullable: true required: - id - type - role - content - model - usage Usage: type: object description: Token counts reported for the request. properties: input_tokens: type: integer description: Number of input tokens charged for the request, not counting any tokens read from cache. output_tokens: type: integer cache_creation_input_tokens: type: integer nullable: true description: Number of input tokens stored into the prompt cache during this request. cache_read_input_tokens: type: integer nullable: true description: Number of input tokens read back from the prompt cache, which are billed at a reduced rate. cache_creation: $ref: '#/components/schemas/CacheCreation' nullable: true service_tier: type: string nullable: true server_tool_use: $ref: '#/components/schemas/ServerToolUsage' nullable: true nexos_credits_cost: type: number format: double description: Cost of the request in nexos credits. required: - input_tokens - output_tokens CacheCreation: type: object description: Breakdown of cache-write tokens split by cache lifetime tier. properties: ephemeral_5m_input_tokens: type: integer ephemeral_1h_input_tokens: type: integer ServerToolUsage: type: object description: Usage counts for each server-side tool, present when those tools ran during the request. properties: web_search_requests: type: integer Container: type: object description: Details of the execution container, included when the request used server-side code execution. properties: id: type: string expires_at: type: string format: date-time required: - id - expires_at MessagesStreamEvent: description: 'Anthropic-native Messages API SSE event. Discriminated by `type`. Forwarded byte-for-byte from the upstream provider — public-api does not transform individual events. ' oneOf: - $ref: '#/components/schemas/MessageStartEvent' - $ref: '#/components/schemas/ContentBlockStartEvent' - $ref: '#/components/schemas/ContentBlockDeltaEvent' - $ref: '#/components/schemas/ContentBlockStopEvent' - $ref: '#/components/schemas/MessageDeltaEvent' - $ref: '#/components/schemas/MessageStopEvent' - $ref: '#/components/schemas/PingEvent' - $ref: '#/components/schemas/ErrorEvent' discriminator: propertyName: type mapping: message_start: '#/components/schemas/MessageStartEvent' content_block_start: '#/components/schemas/ContentBlockStartEvent' content_block_delta: '#/components/schemas/ContentBlockDeltaEvent' content_block_stop: '#/components/schemas/ContentBlockStopEvent' message_delta: '#/components/schemas/MessageDeltaEvent' message_stop: '#/components/schemas/MessageStopEvent' ping: '#/components/schemas/PingEvent' error: '#/components/schemas/ErrorEvent' MessageStartEvent: type: object properties: type: type: string enum: - message_start message: $ref: '#/components/schemas/MessagesResponse' required: - type - message ContentBlockStartEvent: type: object properties: type: type: string enum: - content_block_start index: type: integer content_block: $ref: '#/components/schemas/ContentBlock' required: - type - index - content_block ContentBlockDeltaEvent: type: object properties: type: type: string enum: - content_block_delta index: type: integer delta: $ref: '#/components/schemas/ContentBlockDelta' required: - type - index - delta ContentBlockDelta: oneOf: - $ref: '#/components/schemas/TextDelta' - $ref: '#/components/schemas/InputJsonDelta' - $ref: '#/components/schemas/ThinkingDelta' - $ref: '#/components/schemas/SignatureDelta' - $ref: '#/components/schemas/CitationsDelta' discriminator: propertyName: type mapping: text_delta: '#/components/schemas/TextDelta' input_json_delta: '#/components/schemas/InputJsonDelta' thinking_delta: '#/components/schemas/ThinkingDelta' signature_delta: '#/components/schemas/SignatureDelta' citations_delta: '#/components/schemas/CitationsDelta' TextDelta: type: object properties: type: type: string enum: - text_delta text: type: string required: - type - text InputJsonDelta: type: object properties: type: type: string enum: - input_json_delta partial_json: type: string required: - type - partial_json ThinkingDelta: type: object properties: type: type: string enum: - thinking_delta thinking: type: string required: - type - thinking SignatureDelta: type: object properties: type: type: string enum: - signature_delta signature: type: string required: - type - signature CitationsDelta: type: object properties: type: type: string enum: - citations_delta citation: type: object properties: type: type: string required: - type required: - type - citation ContentBlockStopEvent: type: object properties: type: type: string enum: - content_block_stop index: type: integer required: - type - index MessageDeltaEvent: type: object properties: type: type: string enum: - message_delta delta: $ref: '#/components/schemas/MessageDelta' usage: $ref: '#/components/schemas/Usage' required: - type - delta - usage MessageDelta: type: object description: Top-level message delta carrying terminal stop_reason / stop_sequence. properties: stop_reason: type: string nullable: true enum: - end_turn - max_tokens - stop_sequence - tool_use - pause_turn - refusal stop_sequence: type: string nullable: true MessageStopEvent: type: object properties: type: type: string enum: - message_stop required: - type PingEvent: type: object properties: type: type: string enum: - ping required: - type ErrorEvent: type: object properties: type: type: string enum: - error error: type: object properties: type: type: string message: type: string required: - type - message required: - type - error UserModel: type: object properties: id: type: string description: The model identifier, which can be referenced in the API endpoints. nexos_model_id: type: string description: Internal model identifier, which also can be referenced in the API endpoints. object: type: string description: The object type, which is always "model". created: type: integer format: int64 description: The Unix timestamp (in seconds) when the model was created. updated: type: integer format: int64 description: The Unix timestamp (in seconds) when the model was updated. owned_by: type: string description: The organization that owns the model. name: type: string description: Model name deprecated: true timeout_ms: type: integer format: int32 minimum: 1 description: Model response timeout (milliseconds) stream_timeout_ms: type: integer format: int32 minimum: 1 description: Model response timeout when streaming is enabled (milliseconds) max_tokens: type: integer format: int32 minimum: 1 description: Maximum number of tokens the model can generate in a single request. context_length: type: integer format: int32 minimum: 1 description: Maximum number of context (input) tokens the model supports. pricing: $ref: '#/components/schemas/ModelPricing' endpoints: $ref: '#/components/schemas/Endpoints' required: - id - object - created - updated - name - owned_by ModelPricing: properties: input_cost_per_token: type: string output_cost_per_token: type: string input_cost_per_second: type: string output_cost_per_second: type: string type: object title: Model Pricing Endpoints: type: array items: type: string description: Array of endpoints supported by model enum: - chat_completion - messages - completion - responses - realtime - assistants - batch - fine_tuning - embeddings - image_generation - speech_generation - transcription - translation - moderation ModelFallbacksConfiguration: type: object properties: id: type: string description: Unique identifier for the model fallback_ids: $ref: '#/components/schemas/ModelFallbacks' created_at: type: string format: date-time description: The time the model fallbacks configuration was created. updated_at: type: string format: date-time description: The time the model fallbacks configuration was last updated. required: - id ModelFallbacks: type: array items: type: string format: uuid description: The ID of the model to associate with the company. ModelFallbacksRequest: type: object properties: models: $ref: '#/components/schemas/ModelFallbacks' required: - models CreateResponseRequest: allOf: - $ref: '#/components/schemas/CreateModelResponseProperties' - $ref: '#/components/schemas/ResponseProperties' - type: object properties: input: $ref: '#/components/schemas/InputParam' include: type: array description: 'Specify additional output data to include in the model response. Currently supported values are: - `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).' items: $ref: '#/components/schemas/IncludeEnum' nullable: true parallel_tool_calls: type: boolean description: 'Whether to allow the model to run tool calls in parallel. ' default: true nullable: true store: type: boolean description: 'Whether to store the generated model response for later retrieval via API. ' default: true nullable: true instructions: type: string description: 'A system (or developer) message inserted into the model''s context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. ' nullable: true stream: 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). ' type: boolean default: false nullable: true stream_options: $ref: '#/components/schemas/ResponseStreamOptions' conversation: $ref: '#/components/schemas/ConversationParam' nullable: true CreateModelResponseProperties: allOf: - $ref: '#/components/schemas/ModelResponseProperties' - type: object properties: top_logprobs: description: 'An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. ' type: integer minimum: 0 maximum: 20 ModelResponseProperties: type: object properties: metadata: $ref: '#/components/schemas/responses_Metadata' top_logprobs: description: 'An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. ' type: integer minimum: 0 maximum: 20 nullable: true temperature: type: number minimum: 0 maximum: 2 default: 1 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. ' nullable: true top_p: type: number minimum: 0 maximum: 1 default: 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. ' nullable: true user: type: string deprecated: true description: 'Deprecated in favor of `safety_identifier` and `prompt_cache_key`; use `prompt_cache_key` to maintain caching. A stable end-user identifier to improve cache hit rates and help detect abuse. ' safety_identifier: type: string description: 'A stable identifier used to help detect users who may violate usage policies. Use a unique per-user string (e.g., a hash of username or email) to avoid sending identifying information. ' prompt_cache_key: type: string description: 'Used to cache responses for similar requests and improve cache hit rates. Replaces the `user` field. ' service_tier: $ref: '#/components/schemas/ServiceTier' prompt_cache_retention: type: string enum: - in-memory - 24h description: 'Retention policy for the prompt cache. Set to `24h` to keep cached prefixes active longer (up to 24 hours). ' nullable: true responses_Metadata: type: object 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. ' additionalProperties: type: string nullable: true ServiceTier: type: string description: 'Specifies the processing tier for the request. The response includes the actual tier used, which may differ from the requested value. ' enum: - auto - default - flex - scale - priority default: auto nullable: true ResponseProperties: type: object required: - model properties: previous_response_id: type: string description: 'The unique ID of the previous response to the model. Use this to create multi-turn conversations. Cannot be used with `conversation`. ' nullable: true model: description: 'Model ID used to generate the response (e.g., `gpt-4o` or `o3`). See your provider''s model guide for available options. ' type: string reasoning: $ref: '#/components/schemas/Reasoning' nullable: true background: type: boolean description: 'Whether to run the model response in the background. ' default: false nullable: true max_output_tokens: description: 'An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens. ' type: integer nullable: true max_tool_calls: description: 'The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. ' type: integer nullable: true text: $ref: '#/components/schemas/ResponseTextParam' tools: $ref: '#/components/schemas/ToolsArray' tool_choice: $ref: '#/components/schemas/ToolChoiceParam' prompt: $ref: '#/components/schemas/Prompt' truncation: type: string description: "The truncation strategy to use for the model response.\n- `auto`: If the input\ \ to this Response exceeds\n the model's context window size, the model will truncate the\n\ \ response to fit the context window by dropping items from the beginning of the conversation.\n\ - `disabled` (default): If the input size will exceed the context window\n size for a model,\ \ the request will fail with a 400 error.\n" enum: - auto - disabled default: disabled nullable: true Reasoning: type: object description: 'Configuration options for reasoning models. Applicable to gpt-5 and o-series models only. ' title: Reasoning properties: effort: $ref: '#/components/schemas/ReasoningEffort' mode: type: string description: 'Reasoning mode for models that support it. One of `standard` or `pro`. ' enum: - standard - pro summary: type: string nullable: true description: 'A summary of the model''s reasoning. One of `auto`, `concise`, or `detailed` (only `concise` is supported for `computer-use-preview`). ' enum: - auto - concise - detailed generate_summary: type: string nullable: true deprecated: true description: 'Deprecated: use `summary` instead. A summary of the model''s reasoning. One of `auto`, `concise`, or `detailed`. ' enum: - auto - concise - detailed ReasoningEffort: type: string nullable: true enum: - none - minimal - low - medium - high default: medium description: 'Controls how much reasoning effort the model uses. Lower settings are faster and use fewer tokens; higher settings provide more detailed reasoning. ' ResponseTextParam: type: object description: 'Configuration options for a text response. Supports plain text or structured JSON. ' properties: format: $ref: '#/components/schemas/TextResponseFormatConfiguration' verbosity: $ref: '#/components/schemas/Verbosity' TextResponseFormatConfiguration: description: 'Specifies the required output format. Use `type: json_schema` to enforce a schema; `type: text` is the default. ' anyOf: - $ref: '#/components/schemas/responses_ResponseFormatText' - $ref: '#/components/schemas/TextResponseFormatJsonSchema' - $ref: '#/components/schemas/responses_ResponseFormatJsonObject' discriminator: propertyName: type responses_ResponseFormatText: type: object title: Text description: 'Default response format. Used to generate text responses. ' properties: type: type: string description: The type of response format being defined. Always `text`. enum: - text required: - type TextResponseFormatJsonSchema: type: object title: JSON schema description: 'JSON Schema response format used to generate structured JSON responses. Learn more in the Structured Outputs guide. ' properties: type: type: string description: The type of response format being defined. Always `json_schema`. enum: - json_schema description: 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: 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/responses_ResponseFormatJsonSchemaSchema' strict: type: boolean nullable: true default: false description: 'Whether to enable strict schema adherence when generating the output. If true, the model will follow the exact schema; only a subset of JSON Schema is supported. ' required: - type - schema - name responses_ResponseFormatJsonSchemaSchema: type: object title: JSON schema description: 'The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/). ' additionalProperties: true responses_ResponseFormatJsonObject: type: object title: JSON object 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. ' properties: type: type: string description: The type of response format being defined. Always `json_object`. enum: - json_object required: - type Verbosity: type: string nullable: true enum: - low - medium - high default: medium 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`. ' ToolsArray: type: array description: 'An array of tools the model may call while generating a response. Categories include built-in tools, MCP tools, and custom function calls. ' items: $ref: '#/components/schemas/responses_Tool' responses_Tool: description: 'A tool that can be used to generate a response. ' discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/FunctionTool' - $ref: '#/components/schemas/FileSearchTool' - $ref: '#/components/schemas/ComputerUsePreviewTool' - $ref: '#/components/schemas/WebSearchTool' - $ref: '#/components/schemas/MCPTool' - $ref: '#/components/schemas/CodeInterpreterTool' - $ref: '#/components/schemas/ImageGenTool' - $ref: '#/components/schemas/LocalShellToolParam' - $ref: '#/components/schemas/FunctionShellToolParam' - $ref: '#/components/schemas/CustomToolParam' - $ref: '#/components/schemas/WebSearchPreviewTool' - $ref: '#/components/schemas/ApplyPatchToolParam' FunctionTool: properties: type: type: string enum: - function description: The type of the function tool. Always `function`. default: function name: type: string description: The name of the function to call. description: type: string nullable: true description: A description of the function. Used by the model to determine whether or not to call the function. parameters: type: object nullable: true additionalProperties: {} description: A JSON schema object describing the parameters of the function. strict: type: boolean nullable: true description: Whether to enforce strict parameter validation. Default `true`. type: object required: - type - name - strict - parameters title: Function description: Defines a function in your code that the model can call. FileSearchTool: properties: type: type: string enum: - file_search description: The type of the file search tool. Always `file_search`. default: file_search vector_store_ids: items: type: string type: array description: The IDs of the vector stores to search. max_num_results: type: integer description: The maximum number of results to return. This number should be between 1 and 50 inclusive. ranking_options: $ref: '#/components/schemas/RankingOptions' description: Ranking options for search. filters: $ref: '#/components/schemas/Filters' description: A filter to apply. nullable: true type: object required: - type - vector_store_ids title: File search description: Searches uploaded files for relevant content. See the file search guide. RankingOptions: properties: ranker: $ref: '#/components/schemas/RankerVersionType' description: The ranker to use for the file search. score_threshold: type: number 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/HybridSearchOptions' description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. type: object required: [] RankerVersionType: type: string enum: - auto - default-2024-11-15 HybridSearchOptions: properties: embedding_weight: type: number description: The weight of the embedding in the reciprocal ranking fusion. text_weight: type: number description: The weight of the text in the reciprocal ranking fusion. type: object required: - embedding_weight - text_weight Filters: anyOf: - $ref: '#/components/schemas/ComparisonFilter' - $ref: '#/components/schemas/CompoundFilter' ComparisonFilter: type: object additionalProperties: false title: Comparison Filter description: 'A filter used to compare a specified attribute key to a given value using a defined comparison operation. ' properties: type: type: string default: eq enum: - eq - ne - gt - gte - lt - lte 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 ' key: type: string description: The key to compare against the value. value: description: The value to compare against the attribute key; supports string, number, or boolean types. anyOf: - type: string - type: number - type: boolean - type: array items: $ref: '#/components/schemas/ComparisonFilterValueItems' required: - type - key - value ComparisonFilterValueItems: anyOf: - type: string - type: number CompoundFilter: type: object additionalProperties: false title: Compound Filter description: Combine multiple filters using `and` or `or`. properties: type: type: string description: 'Type of operation: `and` or `or`.' enum: - and - or filters: type: array description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. items: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/ComparisonFilter' - $ref: '#/components/schemas/CompoundFilter' required: - type - filters ComputerUsePreviewTool: properties: type: type: string enum: - computer_use_preview description: The type of the computer use tool. Always `computer_use_preview`. default: computer_use_preview environment: $ref: '#/components/schemas/ComputerEnvironment' description: The type of computer environment to control. display_width: type: integer description: The width of the computer display. display_height: type: integer description: The height of the computer display. type: object required: - type - environment - display_width - display_height title: Computer use preview description: A tool that controls a virtual computer. Learn more in the computer tool guide. ComputerEnvironment: type: string enum: - windows - mac - linux - ubuntu - browser WebSearchTool: type: object title: Web search description: 'Search the internet for sources related to the prompt. Learn more in the web search tool guide. ' properties: type: type: string enum: - web_search - web_search_2025_08_26 description: The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. default: web_search filters: type: object description: 'Filters for the search. ' properties: allowed_domains: type: array title: Allowed domains for the search. description: 'Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. Example: `["pubmed.ncbi.nlm.nih.gov"]` ' items: type: string description: Allowed domain for the search. default: [] nullable: true nullable: true user_location: $ref: '#/components/schemas/WebSearchApproximateLocation' search_context_size: type: string enum: - low - medium - high default: medium 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. required: - type WebSearchApproximateLocation: type: object nullable: true title: Web search approximate location description: 'The approximate location of the user. ' properties: type: type: string enum: - approximate description: The type of location approximation. Always `approximate`. default: approximate country: type: string nullable: true description: The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. region: type: string nullable: true description: Free text input for the region of the user, e.g. `California`. city: type: string nullable: true description: Free text input for the city of the user, e.g. `San Francisco`. timezone: type: string nullable: true description: The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. MCPTool: type: object title: MCP tool description: 'Give the model access to tools via remote Model Context Protocol (MCP) servers. Learn more in the MCP guide. ' properties: type: type: string enum: - mcp description: The type of the MCP tool. Always `mcp`. server_label: type: string description: 'A label for this MCP server, used to identify it in tool calls. ' server_url: type: string description: 'The URL for the MCP server. One of `server_url` or `connector_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` or `connector_id` must be provided. 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` ' 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: type: object additionalProperties: type: string description: 'Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. ' nullable: true allowed_tools: description: 'List of allowed tool names or a filter object. ' anyOf: - type: array title: MCP allowed tools description: A string array of allowed tool names items: type: string - $ref: '#/components/schemas/MCPToolFilter' nullable: true require_approval: description: Specify which of the MCP server's tools require approval. default: always anyOf: - type: object title: MCP tool approval filter description: 'Specify which of the MCP server''s tools require approval. Can be `always`, `never`, or a filter object associated with tools that require approval. ' properties: always: $ref: '#/components/schemas/MCPToolFilter' never: $ref: '#/components/schemas/MCPToolFilter' additionalProperties: false - type: string title: MCP tool approval setting description: 'Specify a single approval policy for all tools. One of `always` or `never`. When set to `always`, all tools will require approval. When set to `never`, all tools will not require approval. ' enum: - always - never nullable: true required: - type - server_label MCPToolFilter: type: object title: MCP tool filter description: 'A filter object to specify which tools are allowed. ' properties: tool_names: type: array title: MCP allowed tools items: type: string description: List of allowed tool names. 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. ' required: [] additionalProperties: false CodeInterpreterTool: type: object title: Code interpreter description: 'A tool that runs Python code to help generate a response to a prompt. ' properties: type: type: string enum: - code_interpreter description: 'The type of the code interpreter tool. Always `code_interpreter`. ' container: description: 'The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code. ' anyOf: - type: string description: The container ID. - $ref: '#/components/schemas/CodeInterpreterContainerAuto' required: - type - container CodeInterpreterContainerAuto: properties: type: type: string enum: - auto description: Always `auto`. default: auto file_ids: items: type: string type: array maxItems: 50 description: An optional list of uploaded files to make available to your code. memory_limit: $ref: '#/components/schemas/ContainerMemoryLimit' nullable: true type: object required: - type title: CodeInterpreterToolAuto description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. ContainerMemoryLimit: type: string enum: - 1g - 4g - 16g - 64g ImageGenTool: type: object title: Image generation tool description: 'A tool that generates images using a model like `gpt-image-1`. ' properties: type: type: string enum: - image_generation description: 'The type of the image generation tool. Always `image_generation`. ' model: type: string enum: - gpt-image-1 - gpt-image-1-mini description: 'The image generation model to use. Default: `gpt-image-1`. ' 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: type: string enum: - 1024x1024 - 1024x1536 - 1536x1024 - auto description: 'The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. ' 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: type: 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: $ref: '#/components/schemas/InputFidelity' nullable: true input_image_mask: type: object description: 'Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional). ' properties: image_url: type: string description: 'Base64-encoded mask image. ' file_id: type: string description: 'File ID for the mask image. ' required: [] additionalProperties: false partial_images: type: integer minimum: 0 maximum: 3 description: 'Number of partial images to generate in streaming mode, from 0 (default value) to 3. ' default: 0 required: - type 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`. Unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. LocalShellToolParam: properties: type: type: string enum: - local_shell description: The type of the local shell tool. Always `local_shell`. default: local_shell type: object required: - type title: Local shell tool description: A tool that allows the model to execute shell commands in a local environment. FunctionShellToolParam: properties: type: type: string enum: - shell description: The type of the shell tool. Always `shell`. default: shell type: object required: - type title: Shell tool description: A tool that allows the model to execute shell commands. CustomToolParam: properties: type: type: string enum: - custom description: The type of the custom tool. Always `custom`. default: custom 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: description: The input format for the custom tool. Default is unconstrained text. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/CustomTextFormatParam' - $ref: '#/components/schemas/CustomGrammarFormatParam' type: object required: - type - name title: Custom tool description: A custom tool that processes input using a specified format. CustomTextFormatParam: properties: type: type: string enum: - text description: Unconstrained text format. Always `text`. default: text type: object required: - type title: Text format description: Unconstrained free-form text. CustomGrammarFormatParam: properties: type: type: string enum: - grammar description: Grammar format. Always `grammar`. default: grammar syntax: $ref: '#/components/schemas/GrammarSyntax1' description: The syntax of the grammar definition. One of `lark` or `regex`. definition: type: string description: The grammar definition. type: object required: - type - syntax - definition title: Grammar format description: A grammar defined by the user. GrammarSyntax1: type: string enum: - lark - regex WebSearchPreviewTool: properties: type: type: string enum: - web_search_preview - web_search_preview_2025_03_11 description: The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. default: web_search_preview user_location: $ref: '#/components/schemas/ApproximateLocation' description: The user's location. nullable: true search_context_size: $ref: '#/components/schemas/SearchContextSize' 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. type: object required: - type title: Web search preview description: Searches the web for relevant results to use in a response. Learn more in the web search tool guide. ApproximateLocation: properties: type: type: string enum: - approximate description: The type of location approximation. Always `approximate`. default: approximate country: type: string description: The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. nullable: true region: type: string description: Free text input for the region of the user, e.g. `California`. nullable: true city: type: string description: Free text input for the city of the user, e.g. `San Francisco`. nullable: true timezone: type: string description: The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. nullable: true type: object required: - type SearchContextSize: type: string enum: - low - medium - high ApplyPatchToolParam: properties: type: type: string enum: - apply_patch description: The type of the tool. Always `apply_patch`. default: apply_patch type: object required: - type title: Apply patch tool description: Allows the assistant to create, delete, or update files using unified diffs. ToolChoiceParam: 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. ' anyOf: - $ref: '#/components/schemas/ToolChoiceOptions' - $ref: '#/components/schemas/ToolChoiceAllowed' - $ref: '#/components/schemas/ToolChoiceTypes' - $ref: '#/components/schemas/ToolChoiceFunction' - $ref: '#/components/schemas/ToolChoiceMCP' - $ref: '#/components/schemas/ToolChoiceCustom' - $ref: '#/components/schemas/SpecificApplyPatchParam' - $ref: '#/components/schemas/SpecificFunctionShellParam' ToolChoiceOptions: type: string title: Tool choice mode 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. ' enum: - none - auto - required ToolChoiceAllowed: type: object title: Allowed tools description: 'Constrains the tools available to the model to a pre-defined set. ' properties: type: type: string enum: - allowed_tools description: Allowed tool configuration type. Always `allowed_tools`. 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: type: array description: "A list of tool definitions that the model should be allowed to call.\n\nFor 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```\n" items: type: object description: 'A tool definition that the model should be allowed to call. ' additionalProperties: true required: - type - mode - tools ToolChoiceTypes: type: object title: Hosted tool description: 'Indicates that the model should use a built-in tool to generate a response. Use this to select a specific hosted capability. ' properties: type: type: string description: "The type of hosted tool the model should to use. \n\nAllowed values are:\n- `file_search`\n\ - `web_search_preview`\n- `computer_use_preview`\n- `code_interpreter`\n- `image_generation`\n" enum: - file_search - web_search_preview - computer_use_preview - web_search_preview_2025_03_11 - image_generation - code_interpreter required: - type ToolChoiceFunction: type: object title: Function tool description: 'Use this option to force the model to call a specific function. ' properties: type: type: string enum: - function description: For function calling, the type is always `function`. name: type: string description: The name of the function to call. required: - type - name ToolChoiceMCP: type: object title: MCP tool description: 'Use this option to force the model to call a specific tool on a remote MCP server. ' properties: type: type: string enum: - mcp description: For MCP tools, the type is always `mcp`. server_label: type: string description: 'The label of the MCP server to use. ' name: type: string description: 'The name of the tool to call on the server. ' nullable: true required: - type - server_label ToolChoiceCustom: type: object title: Custom tool description: 'Use this option to force the model to call a specific custom tool. ' properties: type: type: string enum: - custom description: For custom tool calling, the type is always `custom`. name: type: string description: The name of the custom tool to call. required: - type - name SpecificApplyPatchParam: properties: type: type: string enum: - apply_patch description: The tool to call. Always `apply_patch`. default: apply_patch type: object required: - type title: Specific apply patch tool choice description: Forces the model to call the apply_patch tool when executing a tool call. SpecificFunctionShellParam: properties: type: type: string enum: - shell description: The tool to call. Always `shell`. default: shell type: object required: - type title: Specific shell tool choice description: Forces the model to call the function shell tool when a tool call is required. Prompt: type: object nullable: true description: 'Reference to a prompt template and its variables. ' required: - id properties: id: type: string description: The unique identifier of the prompt template to use. version: type: string nullable: true description: Optional version of the prompt template. variables: $ref: '#/components/schemas/ResponsePromptVariables' ResponsePromptVariables: type: object title: Prompt Variables 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. ' additionalProperties: anyOf: - type: string - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' nullable: true InputTextContent: properties: type: type: string enum: - input_text description: The type of the input item. Always `input_text`. default: input_text text: type: string description: The text input to the model. type: object required: - type - text title: Input text description: A text input to the model. InputImageContent: properties: type: type: string enum: - input_image description: The type of the input item. Always `input_image`. default: input_image image_url: type: string nullable: true description: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. file_id: type: string nullable: true description: The ID of the file to be sent to the model. detail: $ref: '#/components/schemas/ImageDetail' description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. type: object required: - type - detail title: Input image description: An image input to the model. See the vision guide for details. ImageDetail: type: string enum: - low - high - auto InputFileContent: properties: type: type: string enum: - input_file description: The type of the input item. Always `input_file`. default: input_file file_id: type: string nullable: true description: The ID of the file to be sent to the model. filename: type: string description: The name of the file to be sent to the model. file_url: type: string description: The URL 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. ' type: object required: - type title: Input file description: A file input to the model. InputParam: description: 'Text, image, or file inputs used to generate a response. Use this to provide content the model should consider. ' anyOf: - type: string title: Text input description: 'A text input to the model, equivalent to a text input with the `user` role. ' - type: array title: Input item list description: 'A list of one or many input items to the model, containing different content types. ' items: $ref: '#/components/schemas/InputItem' InputItem: discriminator: propertyName: type properties: type: type: string description: The type of the input item. required: - type anyOf: - $ref: '#/components/schemas/EasyInputMessage' - $ref: '#/components/schemas/Item' - $ref: '#/components/schemas/ItemReferenceParam' EasyInputMessage: type: object title: Input message 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. ' properties: role: type: string description: 'The role of the message input. One of `user`, `assistant`, `system`, or `developer`. ' enum: - user - assistant - system - developer content: description: 'Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses. ' anyOf: - type: string title: Text input description: 'A text input to the model. ' - $ref: '#/components/schemas/InputMessageContentList' type: type: string description: 'The type of the message input. Always `message`. ' enum: - message default: message required: - role - content InputMessageContentList: type: array title: Input item content list description: "A list of one or many input items to the model, containing different content \ntypes.\n" items: $ref: '#/components/schemas/InputContent' InputContent: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' Item: type: object description: 'Content item used to generate a response. ' discriminator: propertyName: type properties: type: type: string description: The type of the input item. required: - type anyOf: - $ref: '#/components/schemas/responses_InputMessage' - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/FileSearchToolCall' - $ref: '#/components/schemas/ComputerToolCall' - $ref: '#/components/schemas/ComputerCallOutputItemParam' - $ref: '#/components/schemas/WebSearchToolCall' - $ref: '#/components/schemas/FunctionToolCall' - $ref: '#/components/schemas/FunctionCallOutputItemParam' - $ref: '#/components/schemas/ReasoningItem' - $ref: '#/components/schemas/CompactionSummaryItemParam' - $ref: '#/components/schemas/ImageGenToolCall' - $ref: '#/components/schemas/CodeInterpreterToolCall' - $ref: '#/components/schemas/LocalShellToolCall' - $ref: '#/components/schemas/LocalShellToolCallOutput' - $ref: '#/components/schemas/FunctionShellCallItemParam' - $ref: '#/components/schemas/FunctionShellCallOutputItemParam' - $ref: '#/components/schemas/ApplyPatchToolCallItemParam' - $ref: '#/components/schemas/ApplyPatchToolCallOutputItemParam' - $ref: '#/components/schemas/MCPListTools' - $ref: '#/components/schemas/MCPApprovalRequest' - $ref: '#/components/schemas/MCPApprovalResponse' - $ref: '#/components/schemas/MCPToolCall' - $ref: '#/components/schemas/CustomToolCallOutput' - $ref: '#/components/schemas/CustomToolCall' responses_InputMessage: type: object title: Input message 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. ' properties: type: type: string description: 'The type of the message input. Always set to `message`. ' enum: - message default: message role: type: string description: 'The role of the message input. One of `user`, `system`, or `developer`. ' enum: - user - system - developer status: type: string description: 'The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete content: $ref: '#/components/schemas/InputMessageContentList' required: - role - content OutputMessage: type: object title: Output message description: 'An output message from the model. ' properties: id: type: string description: 'The unique ID of the output message. ' type: type: string description: 'The type of the output message. Always `message`. ' enum: - message default: message role: type: string description: 'The role of the output message. Always `assistant`. ' enum: - assistant content: type: array description: 'The content of the output message. ' items: $ref: '#/components/schemas/OutputMessageContent' status: type: string description: 'The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. ' enum: - in_progress - completed - incomplete required: - id - type - role - content - status OutputMessageContent: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/OutputTextContent' - $ref: '#/components/schemas/RefusalContent' OutputTextContent: properties: type: type: string enum: - output_text description: The type of the output text. Always `output_text`. default: output_text text: type: string description: The text output from the model. annotations: items: $ref: '#/components/schemas/responses_Annotation' type: array description: The annotations of the text output. logprobs: items: $ref: '#/components/schemas/LogProb' type: array type: object required: - type - text - annotations title: Output text description: A text output from the model. responses_Annotation: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/FileCitationBody' - $ref: '#/components/schemas/UrlCitationBody' - $ref: '#/components/schemas/ContainerFileCitationBody' - $ref: '#/components/schemas/FilePath' FileCitationBody: properties: type: type: string enum: - file_citation description: The type of the file citation. Always `file_citation`. default: file_citation file_id: type: string description: The ID of the file. index: type: integer description: The index of the file in the list of files. filename: type: string description: The filename of the file cited. type: object required: - type - file_id - index - filename title: File citation description: A citation to a file. UrlCitationBody: properties: type: type: string enum: - url_citation description: The type of the URL citation. Always `url_citation`. default: url_citation url: type: string description: The URL of the web resource. start_index: type: integer description: The index of the first character of the URL citation in the message. end_index: type: 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. type: object required: - type - url - start_index - end_index - title title: URL citation description: A citation for a web resource used to generate a model response. ContainerFileCitationBody: properties: type: type: string enum: - container_file_citation description: The type of the container file citation. Always `container_file_citation`. default: container_file_citation container_id: type: string description: The ID of the container file. file_id: type: string description: The ID of the file. start_index: type: integer description: The index of the first character of the container file citation in the message. end_index: type: 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. type: object required: - type - container_id - file_id - start_index - end_index - filename title: Container file citation description: A citation for a container file used to generate a model response. FilePath: type: object title: File path description: 'A path to a file. ' properties: type: type: string description: 'The type of the file path. Always `file_path`. ' enum: - file_path file_id: type: string description: 'The ID of the file. ' index: type: integer description: 'The index of the file in the list of files. ' required: - type - file_id - index LogProb: properties: token: type: string logprob: type: number bytes: items: type: integer type: array top_logprobs: items: $ref: '#/components/schemas/TopLogProb' type: array type: object required: - token - logprob - bytes - top_logprobs title: Log probability description: The log probability of a token. TopLogProb: properties: token: type: string logprob: type: number bytes: items: type: integer type: array type: object required: - token - logprob - bytes title: Top log probability description: The top log probability of a token. RefusalContent: properties: type: type: string enum: - refusal description: The type of the refusal. Always `refusal`. default: refusal refusal: type: string description: The refusal explanation from the model. type: object required: - type - refusal title: Refusal description: A refusal from the model. FileSearchToolCall: type: object title: File search tool call description: 'The results of a file search tool call. See the file search guide for more information. ' properties: id: type: string description: 'The unique ID of the file search tool call. ' type: type: string enum: - file_search_call default: file_search_call description: 'The type of the file search tool call. Always `file_search_call`. ' status: type: string description: 'The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`, ' enum: - in_progress - searching - completed - incomplete - failed queries: type: array items: type: string description: 'The queries used to search for files. ' results: type: array description: 'The results of the file search tool call. ' items: type: object properties: file_id: type: string description: 'The unique ID of the file. ' text: type: string description: 'The text that was retrieved from the file. ' filename: type: string description: 'The name of the file. ' attributes: $ref: '#/components/schemas/VectorStoreFileAttributes' score: type: number format: float description: 'The relevance score of the file - a value between 0 and 1. ' nullable: true VectorStoreFileAttributes: type: object nullable: true 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. ' maxProperties: 16 propertyNames: type: string maxLength: 64 additionalProperties: anyOf: - type: string maxLength: 512 - type: number - type: boolean ComputerToolCall: type: object title: Computer tool call description: 'A tool call to a computer use tool. See the computer use guide for more information. ' properties: type: type: string description: The type of the computer call. Always `computer_call`. enum: - 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/ComputerAction' pending_safety_checks: type: array items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' description: 'The pending safety checks for the computer call. ' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - id - action - call_id - pending_safety_checks - status ComputerAction: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/ClickParam' - $ref: '#/components/schemas/DoubleClickAction' - $ref: '#/components/schemas/Drag' - $ref: '#/components/schemas/KeyPressAction' - $ref: '#/components/schemas/Move' - $ref: '#/components/schemas/Screenshot' - $ref: '#/components/schemas/Scroll' - $ref: '#/components/schemas/Type' - $ref: '#/components/schemas/Wait' ClickParam: properties: type: type: string enum: - click description: Specifies the event type. For a click action, this property is always `click`. default: click button: $ref: '#/components/schemas/ClickButtonType' description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. x: type: integer description: The x-coordinate where the click occurred. y: type: integer description: The y-coordinate where the click occurred. type: object required: - type - button - x - y title: Click description: A click action. ClickButtonType: type: string enum: - left - right - wheel - back - forward DoubleClickAction: 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`. default: double_click x: type: integer description: The x-coordinate where the double click occurred. y: type: integer description: The y-coordinate where the double click occurred. type: object required: - type - x - y title: DoubleClick description: A double click action. Drag: type: object title: Drag description: 'A drag action. ' properties: type: type: string enum: - drag default: drag description: "Specifies the event type. For a drag action, this property is \nalways set to\ \ `drag`.\n" path: type: array description: "An array of coordinates representing the path of the drag action. Coordinates\ \ will appear as an array\nof objects, eg\n```\n[\n { x: 100, y: 200 },\n { x: 200, y: 300\ \ }\n]\n```\n" items: $ref: '#/components/schemas/DragPoint' required: - type - path DragPoint: properties: x: type: integer description: The x-coordinate. y: type: integer description: The y-coordinate. type: object required: - x - y title: Coordinate description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.' KeyPressAction: properties: type: type: string enum: - keypress description: Specifies the event type. For a keypress action, this property is always set to `keypress`. default: keypress keys: items: type: string description: One of the keys the model is requesting to be pressed. type: array description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. type: object required: - type - keys title: KeyPress description: A collection of keypresses the model would like to perform. Move: type: object title: Move description: 'A mouse move action. ' properties: type: type: string enum: - move default: move description: "Specifies the event type. For a move action, this property is \nalways set to\ \ `move`.\n" x: type: integer description: 'The x-coordinate to move to. ' y: type: integer description: 'The y-coordinate to move to. ' required: - type - x - y Screenshot: type: object title: Screenshot description: 'A screenshot action. ' properties: type: type: string enum: - screenshot default: screenshot description: "Specifies the event type. For a screenshot action, this property is \nalways set\ \ to `screenshot`.\n" required: - type Scroll: type: object title: Scroll description: 'A scroll action. ' properties: type: type: string enum: - scroll default: scroll description: "Specifies the event type. For a scroll action, this property is \nalways set to\ \ `scroll`.\n" x: type: integer description: 'The x-coordinate where the scroll occurred. ' y: type: integer description: 'The y-coordinate where the scroll occurred. ' scroll_x: type: integer description: 'The horizontal scroll distance. ' scroll_y: type: integer description: 'The vertical scroll distance. ' required: - type - x - y - scroll_x - scroll_y Type: type: object title: Type description: 'An action to type in text. ' properties: type: type: string enum: - type default: type description: "Specifies the event type. For a type action, this property is \nalways set to\ \ `type`.\n" text: type: string description: 'The text to type. ' required: - type - text Wait: type: object title: Wait description: 'A wait action. ' properties: type: type: string enum: - wait default: wait description: "Specifies the event type. For a wait action, this property is \nalways set to\ \ `wait`.\n" required: - type ComputerCallSafetyCheckParam: properties: id: type: string description: The ID of the pending safety check. code: type: string description: The type of the pending safety check. nullable: true message: type: string description: Details about the pending safety check. nullable: true type: object required: - id description: A pending safety check for the computer call. ComputerCallOutputItemParam: properties: id: type: string description: The ID of the computer tool call output. nullable: true call_id: type: string maxLength: 64 minLength: 1 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`. default: computer_call_output output: $ref: '#/components/schemas/ComputerScreenshotImage' acknowledged_safety_checks: items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' type: array description: The safety checks reported by the API that have been acknowledged by the developer. nullable: true status: $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. nullable: true type: object required: - call_id - type - output title: Computer tool call output description: The output of a computer tool call. ComputerScreenshotImage: type: object description: 'A computer screenshot image used with the computer use tool. ' properties: type: type: string enum: - computer_screenshot default: computer_screenshot description: "Specifies the event type. For a computer screenshot, this property is \nalways\ \ set to `computer_screenshot`.\n" image_url: type: string description: The URL of the screenshot image. file_id: type: string description: The identifier of an uploaded file that contains the screenshot. required: - type FunctionCallItemStatus: type: string enum: - in_progress - completed - incomplete WebSearchToolCall: type: object title: Web search tool call description: 'The results of a web search tool call. See the web search guide for more information. ' properties: id: type: string description: 'The unique ID of the web search tool call. ' type: type: string enum: - web_search_call default: web_search_call description: 'The type of the web search tool call. Always `web_search_call`. ' status: type: string description: 'The status of the web search tool call. ' enum: - in_progress - searching - completed - failed action: type: object 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). ' discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/WebSearchActionSearch' - $ref: '#/components/schemas/WebSearchActionOpenPage' - $ref: '#/components/schemas/WebSearchActionFind' required: - id - type - status - action WebSearchActionSearch: type: object title: Search action description: 'Action type "search" - Performs a web search query. ' properties: type: type: string enum: - search description: 'The action type. ' query: type: string description: 'The search query. ' sources: type: array title: Web search sources description: 'The sources used in the search. ' items: type: object title: Web search source description: 'A source used in the search. ' properties: type: type: string enum: - url description: 'The type of source. Always `url`. ' url: type: string description: 'The URL of the source. ' required: - type - url required: - type - query WebSearchActionOpenPage: type: object title: Open page action description: 'Action type "open_page" - Opens a specific URL from search results. ' properties: type: type: string enum: - open_page description: 'The action type. ' url: type: string format: uri description: 'The URL opened by the model. ' required: - type - url WebSearchActionFind: type: object title: Find action description: 'Action type "find": Searches for a pattern within a loaded page. ' properties: type: type: string enum: - find description: 'The action type. ' url: type: string format: uri description: 'The URL of the page searched for the pattern. ' pattern: type: string description: 'The pattern or text to search for within the page. ' required: - type - url - pattern FunctionToolCall: type: object title: Function tool call description: 'A tool call to run a function. Used when the model requests your code to execute a function. ' properties: id: type: string description: 'The unique ID of the function tool call. ' type: type: string enum: - function_call default: function_call description: 'The type of the function tool call. Always `function_call`. ' call_id: type: string description: 'The unique ID of the function tool call generated by the model. ' 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 description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - call_id - name - arguments FunctionCallOutputItemParam: properties: id: type: string description: The unique ID of the function tool call output. Populated when this item is returned via API. nullable: true call_id: type: string maxLength: 64 minLength: 1 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`. default: function_call_output output: description: Text, image, or file output of the function tool call. anyOf: - type: string maxLength: 10485760 description: A JSON string of the output of the function tool call. - items: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/InputTextContentParam' - $ref: '#/components/schemas/InputImageContentParamAutoParam' - $ref: '#/components/schemas/InputFileContentParam' type: array status: $ref: '#/components/schemas/FunctionCallItemStatus' description: The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. nullable: true type: object required: - call_id - type - output title: Function tool call output description: The output of a function tool call. InputTextContentParam: properties: type: type: string enum: - input_text description: The type of the input item. Always `input_text`. default: input_text text: type: string maxLength: 10485760 description: The text input to the model. type: object required: - type - text title: Input text description: A text input to the model. InputImageContentParamAutoParam: properties: type: type: string enum: - input_image description: The type of the input item. Always `input_image`. default: input_image image_url: type: string maxLength: 20971520 nullable: true description: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. file_id: type: string nullable: true description: The ID of the file to be sent to the model. detail: $ref: '#/components/schemas/DetailEnum' nullable: true description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. type: object required: - type title: Input image description: An image input to the model. DetailEnum: type: string enum: - low - high - auto InputFileContentParam: properties: type: type: string enum: - input_file description: The type of the input item. Always `input_file`. default: input_file file_id: type: string nullable: true description: The ID of the file to be sent to the model. filename: type: string nullable: true description: The name of the file to be sent to the model. file_data: type: string maxLength: 33554432 nullable: true description: The base64-encoded data of the file to be sent to the model. file_url: type: string nullable: true description: The URL of the file to be sent to the model. type: object required: - type title: Input file description: A file input to the model. ReasoningItem: type: object description: 'A description of the chain of thought used by a reasoning model while generating a response. Include these items in your input for subsequent turns if you are manually managing context. ' title: Reasoning properties: type: type: string description: 'The type of the object. Always `reasoning`. ' enum: - reasoning default: reasoning id: type: string description: 'The unique identifier of the reasoning content. ' encrypted_content: type: string description: 'The encrypted content of the reasoning item - populated when a response is generated with `reasoning.encrypted_content` in the `include` parameter. ' nullable: true summary: type: array description: 'Reasoning summary content. ' items: $ref: '#/components/schemas/Summary' content: type: array description: 'Reasoning text content. ' items: $ref: '#/components/schemas/ReasoningTextContent' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - id - summary - type Summary: properties: type: type: string enum: - summary_text description: The type of the object. Always `summary_text`. default: summary_text text: type: string description: A summary of the reasoning output from the model so far. type: object required: - type - text title: Summary text description: A summary text from the model. ReasoningTextContent: properties: type: type: string enum: - reasoning_text description: The type of the reasoning text. Always `reasoning_text`. default: reasoning_text text: type: string description: The reasoning text from the model. type: object required: - type - text title: ReasoningTextContent description: Reasoning text from the model. CompactionSummaryItemParam: properties: id: type: string description: The ID of the compaction item. nullable: true type: type: string enum: - compaction description: The type of the item. Always `compaction`. default: compaction encrypted_content: type: string maxLength: 10485760 type: object required: - type - encrypted_content title: Compaction item description: A compaction item generated by the `v1/responses/compact` API. ImageGenToolCall: type: object title: Image generation call description: 'An image generation request made by the model. ' properties: type: type: string enum: - image_generation_call default: image_generation_call description: 'The type of the image generation call. Always `image_generation_call`. ' 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: type: string description: 'The generated image encoded in base64. ' nullable: true required: - type - id - status - result CodeInterpreterToolCall: type: object title: Code interpreter tool call description: 'A tool call to run code. ' properties: type: type: string enum: - code_interpreter_call default: code_interpreter_call description: 'The type of the code interpreter tool call. Always `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: type: string description: 'The code to run, or null if not available. ' nullable: true outputs: type: array items: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/CodeInterpreterOutputLogs' - $ref: '#/components/schemas/CodeInterpreterOutputImage' discriminator: propertyName: type description: 'The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available. ' nullable: true required: - type - id - status - container_id - code - outputs CodeInterpreterOutputLogs: properties: type: type: string enum: - logs description: The type of the output. Always `logs`. default: logs logs: type: string description: The logs output from the code interpreter. type: object required: - type - logs title: Code interpreter output logs description: The logs output from the code interpreter. CodeInterpreterOutputImage: properties: type: type: string enum: - image description: The type of the output. Always `image`. default: image url: type: string description: The URL of the image output from the code interpreter. type: object required: - type - url title: Code interpreter output image description: The image output from the code interpreter. LocalShellToolCall: type: object title: Local shell call description: 'A tool call to run a command on the local shell. ' properties: type: type: string enum: - local_shell_call default: local_shell_call description: 'The type of the local shell call. Always `local_shell_call`. ' 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/LocalShellExecAction' status: type: string enum: - in_progress - completed - incomplete description: 'The status of the local shell call. ' required: - type - id - call_id - action - status LocalShellExecAction: properties: type: type: string enum: - exec description: The type of the local shell action. Always `exec`. default: exec command: items: type: string type: array description: The command to run. timeout_ms: type: integer nullable: true description: Optional timeout in milliseconds for the command. working_directory: type: string nullable: true description: Optional working directory to run the command in. env: additionalProperties: type: string type: object description: Environment variables to set for the command. user: type: string nullable: true description: Optional user to run the command as. type: object required: - type - command - env title: Local shell exec action description: Execute a shell command on the server. LocalShellToolCallOutput: type: object title: Local shell call output description: 'The output of a local shell tool call. ' properties: type: type: string enum: - local_shell_call_output default: local_shell_call_output description: 'The type of the local shell tool call output. Always `local_shell_call_output`. ' 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: ype: string enum: - in_progress - completed - incomplete description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. ' nullable: true required: - id - type - call_id - output FunctionShellCallItemParam: properties: id: type: string description: The unique ID of the function shell tool call. Populated when this item is returned via API. nullable: true call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the function shell tool call generated by the model. type: type: string enum: - shell_call description: The type of the item. Always `function_shell_call`. default: shell_call action: $ref: '#/components/schemas/FunctionShellActionParam' description: The shell commands and limits that describe how to run the tool call. status: $ref: '#/components/schemas/FunctionShellCallItemStatus' nullable: true type: object required: - call_id - type - action title: Function shell tool call description: A tool representing a request to execute one or more shell commands. FunctionShellActionParam: properties: commands: items: type: string type: array description: Ordered shell commands for the execution environment to run. timeout_ms: type: integer description: Maximum wall-clock time in milliseconds to allow the shell commands to run. nullable: true max_output_length: type: integer description: Maximum number of UTF-8 characters to capture from combined stdout and stderr output. nullable: true type: object required: - commands title: Function shell action description: Commands and limits describing how to run the function shell tool call. FunctionShellCallItemStatus: type: string enum: - in_progress - completed - incomplete title: Function shell call status description: Status values reported for function shell tool calls. FunctionShellCallOutputItemParam: properties: id: type: string description: The unique ID of the function shell tool call output. Populated when this item is returned via API. nullable: true call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the function shell tool call generated by the model. type: type: string enum: - shell_call_output description: The type of the item. Always `function_shell_call_output`. default: shell_call_output output: items: $ref: '#/components/schemas/FunctionShellCallOutputContentParam' type: array description: Captured chunks of stdout and stderr output, along with their associated outcomes. max_output_length: type: integer description: The maximum number of UTF-8 characters captured for this shell call's combined output. nullable: true type: object required: - call_id - type - output title: Function shell tool call output description: The streamed output items emitted by a function shell tool call. FunctionShellCallOutputContentParam: properties: stdout: type: string maxLength: 10485760 description: Captured stdout output for this chunk of the shell call. stderr: type: string maxLength: 10485760 description: Captured stderr output for this chunk of the shell call. outcome: $ref: '#/components/schemas/FunctionShellCallOutputOutcomeParam' description: The exit or timeout outcome associated with this chunk. type: object required: - stdout - stderr - outcome title: Function shell output chunk description: Captured stdout and stderr for a portion of a function shell tool call output. FunctionShellCallOutputOutcomeParam: title: Function shell call outcome description: The exit or timeout outcome associated with this chunk. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/FunctionShellCallOutputTimeoutOutcomeParam' - $ref: '#/components/schemas/FunctionShellCallOutputExitOutcomeParam' FunctionShellCallOutputTimeoutOutcomeParam: properties: type: type: string enum: - timeout description: The outcome type. Always `timeout`. default: timeout type: object required: - type title: Function shell timeout outcome description: Indicates that the function shell call exceeded its configured time limit. FunctionShellCallOutputExitOutcomeParam: properties: type: type: string enum: - exit description: The outcome type. Always `exit`. default: exit exit_code: type: integer description: The exit code returned by the shell process. type: object required: - type - exit_code title: Function shell exit outcome description: Indicates that the shell commands finished and returned an exit code. ApplyPatchToolCallItemParam: properties: type: type: string enum: - apply_patch_call description: The type of the item. Always `apply_patch_call`. 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. nullable: true call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the apply patch tool call generated by the model. status: $ref: '#/components/schemas/ApplyPatchCallStatusParam' description: The status of the apply patch tool call. One of `in_progress` or `completed`. operation: $ref: '#/components/schemas/ApplyPatchOperationParam' description: The specific create, delete, or update instruction for the apply_patch tool call. type: object required: - type - call_id - status - operation title: Apply patch tool call description: A tool call representing a request to create, delete, or update files using diff patches. ApplyPatchCallStatusParam: type: string enum: - in_progress - completed title: Apply patch call status description: Status values reported for apply_patch tool calls. ApplyPatchOperationParam: title: Apply patch operation description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/ApplyPatchCreateFileOperationParam' - $ref: '#/components/schemas/ApplyPatchDeleteFileOperationParam' - $ref: '#/components/schemas/ApplyPatchUpdateFileOperationParam' ApplyPatchCreateFileOperationParam: properties: type: type: string enum: - create_file description: The operation type. Always `create_file`. default: create_file 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. type: object required: - type - path - diff title: Apply patch create file operation description: Instruction for creating a new file via the apply_patch tool. ApplyPatchDeleteFileOperationParam: properties: type: type: string enum: - delete_file description: The operation type. Always `delete_file`. default: delete_file path: type: string minLength: 1 description: Path of the file to delete relative to the workspace root. type: object required: - type - path title: Apply patch delete file operation description: Instruction for deleting an existing file via the apply_patch tool. ApplyPatchUpdateFileOperationParam: properties: type: type: string enum: - update_file description: The operation type. Always `update_file`. default: update_file 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. type: object required: - type - path - diff title: Apply patch update file operation description: Instruction for updating an existing file via the apply_patch tool. ApplyPatchToolCallOutputItemParam: properties: type: type: string enum: - apply_patch_call_output description: The type of the item. Always `apply_patch_call_output`. 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. nullable: true call_id: type: string maxLength: 64 minLength: 1 description: The unique ID of the apply patch tool call generated by the model. status: $ref: '#/components/schemas/ApplyPatchCallOutputStatusParam' description: The status of the apply patch tool call output. One of `completed` or `failed`. output: type: string maxLength: 10485760 description: Optional human-readable log text from the apply patch tool (e.g., patch results or errors). nullable: true type: object required: - type - call_id - status title: Apply patch tool call output description: The streamed output emitted by an apply patch tool call. ApplyPatchCallOutputStatusParam: type: string enum: - completed - failed title: Apply patch call output status description: Outcome values reported for apply_patch tool call outputs. MCPListTools: type: object title: MCP list tools description: 'A list of tools available on an MCP server. ' properties: type: type: string enum: - mcp_list_tools default: mcp_list_tools description: 'The type of the item. Always `mcp_list_tools`. ' 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/MCPListToolsTool' description: 'The tools available on the server. ' error: type: string description: 'Error message if the server could not list tools. ' nullable: true required: - type - id - server_label - tools MCPListToolsTool: type: object title: MCP list tools tool description: 'A tool available on an MCP server. ' properties: name: type: string description: 'The name of the tool. ' description: type: string description: 'The description of the tool. ' nullable: true input_schema: type: object description: 'The JSON schema describing the tool''s input. ' annotations: type: object description: 'Additional annotations about the tool. ' nullable: true required: - name - input_schema MCPApprovalRequest: type: object title: MCP approval request description: 'A request for human approval of a tool invocation. ' properties: type: type: string enum: - mcp_approval_request default: mcp_approval_request description: 'The type of the item. Always `mcp_approval_request`. ' 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. ' required: - type - id - server_label - name - arguments MCPApprovalResponse: type: object title: MCP approval response description: 'A response to an MCP approval request. ' properties: type: type: string enum: - mcp_approval_response default: mcp_approval_response description: 'The type of the item. Always `mcp_approval_response`. ' id: type: string description: 'The unique ID of the approval response ' nullable: true approval_request_id: type: string description: 'The ID of the approval request being answered. ' approve: type: boolean description: 'Whether the request was approved. ' reason: type: string description: 'Optional reason for the decision. ' nullable: true required: - type - request_id - approve - approval_request_id MCPToolCall: type: object title: MCP tool call description: 'An invocation of a tool on an MCP server. ' properties: type: type: string enum: - mcp_call default: mcp_call description: 'The type of the item. Always `mcp_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: 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: type: string description: 'The output from the tool call. ' nullable: true error: type: string description: 'The error from the tool call, if any. ' nullable: true status: $ref: '#/components/schemas/MCPToolCallStatus' description: 'The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. ' approval_request_id: type: string description: 'Unique identifier for the MCP tool call approval request. Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. ' nullable: true required: - type - id - server_label - name - arguments MCPToolCallStatus: type: string enum: - in_progress - completed - incomplete - calling - failed CustomToolCallOutput: type: object title: Custom tool call output description: 'The output of a custom tool call from your code, being sent back to the model. ' properties: type: type: string enum: - custom_tool_call_output default: custom_tool_call_output description: 'The type of the custom tool call output. Always `custom_tool_call_output`. ' id: type: string description: 'The unique ID of the custom tool call output in the platform. ' call_id: type: string description: 'The call ID, used to map this custom tool call output to a custom tool call. ' output: description: 'The output from the custom tool call generated by your code. Can be a string or an list of output content. ' anyOf: - type: string description: 'A string of the output of the custom tool call. ' title: string output - type: array items: $ref: '#/components/schemas/FunctionAndCustomToolCallOutput' title: output content list description: 'Text, image, or file output of the custom tool call. ' required: - type - call_id - output FunctionAndCustomToolCallOutput: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/InputImageContent' - $ref: '#/components/schemas/InputFileContent' CustomToolCall: type: object title: Custom tool call description: 'A call to a custom tool created by the model. ' properties: type: type: string enum: - custom_tool_call default: custom_tool_call description: 'The type of the custom tool call. Always `custom_tool_call`. ' id: type: string description: 'The unique ID of the custom tool call in the platform. ' call_id: type: string description: 'An identifier used to map this custom tool call to a tool call output. ' 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. ' required: - type - call_id - name - input ItemReferenceParam: properties: type: type: string nullable: true enum: - item_reference description: The type of item to reference. Always `item_reference`. default: item_reference id: type: string description: The ID of the item to reference. type: object required: - id title: Item reference description: An internal identifier for an item to reference. IncludeEnum: 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 description: 'Specify additional output data to include in the model response. Currently supported values are: - `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).' ResponseStreamOptions: description: 'Options for streaming responses. Only set this when you set `stream: true`. ' 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 API. ' nullable: true ConversationParam: 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. ' anyOf: - type: string title: Conversation ID description: 'The unique ID of the conversation. ' - $ref: '#/components/schemas/ConversationParam-2' ConversationParam-2: properties: id: type: string description: The unique ID of the conversation. type: object required: - id title: Conversation object description: The conversation that this response belongs to. Response: title: The response object allOf: - $ref: '#/components/schemas/ModelResponseProperties' - $ref: '#/components/schemas/ResponseProperties' - type: object properties: id: type: string description: 'Unique identifier for this Response. ' object: type: string description: 'The object type of this resource - always set to `response`. ' enum: - response status: type: string description: 'The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`. ' enum: - completed - failed - in_progress - cancelled - queued - incomplete created_at: type: number description: 'Unix timestamp (in seconds) of when this Response was created. ' error: $ref: '#/components/schemas/ResponseError' incomplete_details: type: object description: 'Details about why the response is incomplete. ' properties: reason: type: string description: The reason why the response is incomplete. enum: - max_output_tokens - content_filter nullable: true output: type: array description: "An array of content items generated by the model.\n\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.\n" items: $ref: '#/components/schemas/OutputItem' instructions: description: 'A system (or developer) message inserted into the model''s context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. ' anyOf: - type: string description: 'A text input to the model, equivalent to a text input with the `developer` role. ' - type: array title: Input item list description: 'A list of one or many input items to the model, containing different content types. ' items: $ref: '#/components/schemas/InputItem' nullable: true output_text: type: string description: 'SDK-only convenience property that contains the aggregated text output from all `output_text` items in the `output` array, if any are present. Supported in the Python and JavaScript SDKs. ' nullable: true usage: $ref: '#/components/schemas/ResponseUsage' parallel_tool_calls: type: boolean description: 'Whether to allow the model to run tool calls in parallel. ' default: true conversation: $ref: '#/components/schemas/Conversation-2' nullable: true required: - id - object - created_at - error - incomplete_details - instructions - model - tools - output - parallel_tool_calls - metadata - tool_choice - temperature - top_p ResponseError: type: object description: 'An error object returned when the model fails to generate a Response. ' properties: code: $ref: '#/components/schemas/ResponseErrorCode' message: type: string description: 'A human-readable description of the error. ' required: - code - message nullable: true ResponseErrorCode: type: string description: 'The error code for the response. ' 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 OutputItem: anyOf: - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/FileSearchToolCall' - $ref: '#/components/schemas/FunctionToolCall' - $ref: '#/components/schemas/WebSearchToolCall' - $ref: '#/components/schemas/ComputerToolCall' - $ref: '#/components/schemas/ReasoningItem' - $ref: '#/components/schemas/ImageGenToolCall' - $ref: '#/components/schemas/CodeInterpreterToolCall' - $ref: '#/components/schemas/LocalShellToolCall' - $ref: '#/components/schemas/FunctionShellCall' - $ref: '#/components/schemas/FunctionShellCallOutput' - $ref: '#/components/schemas/ApplyPatchToolCall' - $ref: '#/components/schemas/ApplyPatchToolCallOutput' - $ref: '#/components/schemas/MCPToolCall' - $ref: '#/components/schemas/MCPListTools' - $ref: '#/components/schemas/MCPApprovalRequest' - $ref: '#/components/schemas/CustomToolCall' discriminator: propertyName: type properties: type: type: string description: The type of the input item. required: - type FunctionShellCall: properties: type: type: string enum: - shell_call description: The type of the item. Always `shell_call`. default: shell_call id: type: string description: The unique ID of the function shell tool call. Populated when this item is returned via API. call_id: type: string description: The unique ID of the function shell tool call generated by the model. action: $ref: '#/components/schemas/FunctionShellAction' description: The shell commands and limits that describe how to run the tool call. status: $ref: '#/components/schemas/LocalShellCallStatus' description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. created_by: type: string description: The ID of the entity that created this tool call. type: object required: - type - id - call_id - action - status title: Function shell tool call description: A tool call that executes one or more shell commands in a managed environment. FunctionShellAction: properties: commands: items: type: string description: A list of commands to run. type: array timeout_ms: type: integer description: Optional timeout in milliseconds for the commands. nullable: true max_output_length: type: integer description: Optional maximum number of characters to return from each command. nullable: true type: object required: - commands - timeout_ms - max_output_length title: Shell exec action description: Execute a shell command. LocalShellCallStatus: type: string enum: - in_progress - completed - incomplete FunctionShellCallOutput: properties: type: type: string enum: - shell_call_output description: The type of the shell call output. Always `shell_call_output`. 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. output: items: $ref: '#/components/schemas/FunctionShellCallOutputContent' type: array description: An array of shell call output contents max_output_length: type: integer description: The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. nullable: true created_by: type: string type: object required: - type - id - call_id - output - max_output_length title: Shell call output description: The output of a shell tool call. FunctionShellCallOutputContent: properties: stdout: type: string stderr: type: string outcome: title: Function shell call outcome description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/FunctionShellCallOutputTimeoutOutcome' - $ref: '#/components/schemas/FunctionShellCallOutputExitOutcome' created_by: type: string type: object required: - stdout - stderr - outcome title: Shell call output content description: The content of a shell call output. FunctionShellCallOutputTimeoutOutcome: properties: type: type: string enum: - timeout description: The outcome type. Always `timeout`. default: timeout type: object required: - type title: Function shell timeout outcome description: Indicates that the function shell call exceeded its configured time limit. FunctionShellCallOutputExitOutcome: properties: type: type: string enum: - exit description: The outcome type. Always `exit`. default: exit exit_code: type: integer description: Exit code from the shell process. type: object required: - type - exit_code title: Function shell exit outcome description: Indicates that the shell commands finished and returned an exit code. ApplyPatchToolCall: properties: type: type: string enum: - apply_patch_call description: The type of the item. Always `apply_patch_call`. 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/ApplyPatchCallStatus' description: The status of the apply patch tool call. One of `in_progress` or `completed`. operation: title: Apply patch operation description: One of the create_file, delete_file, or update_file operations applied via apply_patch. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/ApplyPatchCreateFileOperation' - $ref: '#/components/schemas/ApplyPatchDeleteFileOperation' - $ref: '#/components/schemas/ApplyPatchUpdateFileOperation' created_by: type: string description: The ID of the entity that created this tool call. type: object required: - type - id - call_id - status - operation title: Apply patch tool call description: A tool call that applies file diffs by creating, deleting, or updating files. ApplyPatchCallStatus: type: string enum: - in_progress - completed ApplyPatchCreateFileOperation: properties: type: type: string enum: - create_file description: Create a new file with the provided diff. default: create_file path: type: string description: Path of the file to create. diff: type: string description: Diff to apply. type: object required: - type - path - diff title: Apply patch create file operation description: Instruction describing how to create a file via the apply_patch tool. ApplyPatchDeleteFileOperation: properties: type: type: string enum: - delete_file description: Delete the specified file. default: delete_file path: type: string description: Path of the file to delete. type: object required: - type - path title: Apply patch delete file operation description: Instruction describing how to delete a file via the apply_patch tool. ApplyPatchUpdateFileOperation: properties: type: type: string enum: - update_file description: Update an existing file with the provided diff. default: update_file path: type: string description: Path of the file to update. diff: type: string description: Diff to apply. type: object required: - type - path - diff title: Apply patch update file operation description: Instruction describing how to update a file via the apply_patch tool. ApplyPatchToolCallOutput: properties: type: type: string enum: - apply_patch_call_output description: The type of the item. Always `apply_patch_call_output`. 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/ApplyPatchCallOutputStatus' description: The status of the apply patch tool call output. One of `completed` or `failed`. output: type: string description: Optional textual output returned by the apply patch tool. nullable: true created_by: type: string description: The ID of the entity that created this tool call output. type: object required: - type - id - call_id - status title: Apply patch tool call output description: The output emitted by an apply patch tool call. ApplyPatchCallOutputStatus: type: string enum: - completed - failed ResponseUsage: type: object description: 'Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. ' properties: input_tokens: type: integer description: The number of input tokens. input_tokens_details: type: object description: A detailed breakdown of the input tokens. properties: cached_tokens: type: integer description: 'The number of tokens retrieved from cache. See prompt caching for details. ' required: - cached_tokens output_tokens: type: integer description: The number of output tokens. output_tokens_details: type: object description: A detailed breakdown of the output tokens. properties: reasoning_tokens: type: integer description: The number of reasoning tokens. required: - reasoning_tokens total_tokens: type: integer description: The total number of tokens used. nexos_credits_cost: type: number format: double description: Cost of the request in nexos credits. required: - input_tokens - input_tokens_details - output_tokens - output_tokens_details - total_tokens Conversation-2: properties: id: type: string description: The unique ID of the conversation. type: object required: - id title: Conversation description: The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation. ResponseStreamEvent: anyOf: - $ref: '#/components/schemas/ResponseAudioDeltaEvent' - $ref: '#/components/schemas/ResponseAudioDoneEvent' - $ref: '#/components/schemas/ResponseAudioTranscriptDeltaEvent' - $ref: '#/components/schemas/ResponseAudioTranscriptDoneEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDeltaEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDoneEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallCompletedEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallInProgressEvent' - $ref: '#/components/schemas/ResponseCodeInterpreterCallInterpretingEvent' - $ref: '#/components/schemas/ResponseCompletedEvent' - $ref: '#/components/schemas/ResponseContentPartAddedEvent' - $ref: '#/components/schemas/ResponseContentPartDoneEvent' - $ref: '#/components/schemas/ResponseCreatedEvent' - $ref: '#/components/schemas/ResponseErrorEvent' - $ref: '#/components/schemas/ResponseFileSearchCallCompletedEvent' - $ref: '#/components/schemas/ResponseFileSearchCallInProgressEvent' - $ref: '#/components/schemas/ResponseFileSearchCallSearchingEvent' - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDeltaEvent' - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDoneEvent' - $ref: '#/components/schemas/ResponseInProgressEvent' - $ref: '#/components/schemas/ResponseFailedEvent' - $ref: '#/components/schemas/ResponseIncompleteEvent' - $ref: '#/components/schemas/ResponseOutputItemAddedEvent' - $ref: '#/components/schemas/ResponseOutputItemDoneEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryPartAddedEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryPartDoneEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryTextDeltaEvent' - $ref: '#/components/schemas/ResponseReasoningSummaryTextDoneEvent' - $ref: '#/components/schemas/ResponseReasoningTextDeltaEvent' - $ref: '#/components/schemas/ResponseReasoningTextDoneEvent' - $ref: '#/components/schemas/ResponseRefusalDeltaEvent' - $ref: '#/components/schemas/ResponseRefusalDoneEvent' - $ref: '#/components/schemas/ResponseTextDeltaEvent' - $ref: '#/components/schemas/ResponseTextDoneEvent' - $ref: '#/components/schemas/ResponseWebSearchCallCompletedEvent' - $ref: '#/components/schemas/ResponseWebSearchCallInProgressEvent' - $ref: '#/components/schemas/ResponseWebSearchCallSearchingEvent' - $ref: '#/components/schemas/ResponseImageGenCallCompletedEvent' - $ref: '#/components/schemas/ResponseImageGenCallGeneratingEvent' - $ref: '#/components/schemas/ResponseImageGenCallInProgressEvent' - $ref: '#/components/schemas/ResponseImageGenCallPartialImageEvent' - $ref: '#/components/schemas/ResponseMCPCallArgumentsDeltaEvent' - $ref: '#/components/schemas/ResponseMCPCallArgumentsDoneEvent' - $ref: '#/components/schemas/ResponseMCPCallCompletedEvent' - $ref: '#/components/schemas/ResponseMCPCallFailedEvent' - $ref: '#/components/schemas/ResponseMCPCallInProgressEvent' - $ref: '#/components/schemas/ResponseMCPListToolsCompletedEvent' - $ref: '#/components/schemas/ResponseMCPListToolsFailedEvent' - $ref: '#/components/schemas/ResponseMCPListToolsInProgressEvent' - $ref: '#/components/schemas/ResponseOutputTextAnnotationAddedEvent' - $ref: '#/components/schemas/ResponseQueuedEvent' - $ref: '#/components/schemas/ResponseCustomToolCallInputDeltaEvent' - $ref: '#/components/schemas/ResponseCustomToolCallInputDoneEvent' discriminator: propertyName: type ResponseAudioDeltaEvent: type: object description: Emitted when there is a partial audio response. properties: type: type: string description: 'The type of the event. Always `response.audio.delta`. ' enum: - response.audio.delta sequence_number: type: integer description: 'A sequence number for this chunk of the stream response. ' delta: type: string description: 'A chunk of Base64 encoded response audio bytes. ' required: - type - delta - sequence_number ResponseAudioDoneEvent: type: object description: Emitted when the audio response is complete. properties: type: type: string description: 'The type of the event. Always `response.audio.done`. ' enum: - response.audio.done sequence_number: type: integer description: 'The sequence number of the delta. ' required: - type - sequence_number - response_id ResponseAudioTranscriptDeltaEvent: type: object description: Emitted when there is a partial transcript of audio. properties: type: type: string description: 'The type of the event. Always `response.audio.transcript.delta`. ' enum: - response.audio.transcript.delta delta: type: string description: 'The partial transcript of the audio response. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response_id - delta - sequence_number ResponseAudioTranscriptDoneEvent: type: object description: Emitted when the full audio transcript is completed. properties: type: type: string description: 'The type of the event. Always `response.audio.transcript.done`. ' enum: - response.audio.transcript.done sequence_number: type: integer description: The sequence number of this event. required: - type - response_id - sequence_number ResponseCodeInterpreterCallCodeDeltaEvent: type: object description: Emitted when a partial code snippet is streamed by the code interpreter. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call_code.delta`. enum: - response.code_interpreter_call_code.delta output_index: type: 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. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - delta - sequence_number ResponseCodeInterpreterCallCodeDoneEvent: type: object description: Emitted when the code snippet is finalized by the code interpreter. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call_code.done`. enum: - response.code_interpreter_call_code.done output_index: type: 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: type: string description: The final code snippet output by the code interpreter. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - code - sequence_number ResponseCodeInterpreterCallCompletedEvent: type: object description: Emitted when the code interpreter call is completed. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.completed`. enum: - response.code_interpreter_call.completed output_index: type: 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. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number ResponseCodeInterpreterCallInProgressEvent: type: object description: Emitted when a code interpreter call is in progress. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.in_progress`. enum: - response.code_interpreter_call.in_progress output_index: type: 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. sequence_number: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number ResponseCodeInterpreterCallInterpretingEvent: type: object description: Emitted when the code interpreter is actively interpreting the code snippet. properties: type: type: string description: The type of the event. Always `response.code_interpreter_call.interpreting`. enum: - response.code_interpreter_call.interpreting output_index: type: 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: type: integer description: The sequence number of this event, used to order streaming events. required: - type - output_index - item_id - sequence_number ResponseCompletedEvent: type: object description: Emitted when the model response is complete. properties: type: type: string description: 'The type of the event. Always `response.completed`. ' enum: - response.completed response: $ref: '#/components/schemas/Response' description: 'Properties of the completed response. ' sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number ResponseContentPartAddedEvent: type: object description: Emitted when a new content part is added. properties: type: type: string description: 'The type of the event. Always `response.content_part.added`. ' enum: - response.content_part.added item_id: type: string description: 'The ID of the output item that the content part was added to. ' output_index: type: integer description: 'The index of the output item that the content part was added to. ' content_index: type: integer description: 'The index of the content part that was added. ' part: $ref: '#/components/schemas/OutputContent' description: 'The content part that was added. ' sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - content_index - part - sequence_number OutputContent: discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/OutputTextContent' - $ref: '#/components/schemas/RefusalContent' - $ref: '#/components/schemas/ReasoningTextContent' ResponseContentPartDoneEvent: type: object description: Emitted when a content part is done. properties: type: type: string description: 'The type of the event. Always `response.content_part.done`. ' enum: - response.content_part.done item_id: type: string description: 'The ID of the output item that the content part was added to. ' output_index: type: integer description: 'The index of the output item that the content part was added to. ' content_index: type: integer description: 'The index of the content part that is done. ' sequence_number: type: integer description: The sequence number of this event. part: $ref: '#/components/schemas/OutputContent' description: 'The content part that is done. ' required: - type - item_id - output_index - content_index - part - sequence_number ResponseCreatedEvent: type: object description: 'An event that is emitted when a response is created. ' properties: type: type: string description: 'The type of the event. Always `response.created`. ' enum: - response.created response: $ref: '#/components/schemas/Response' description: 'The response that was created. ' sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number ResponseErrorEvent: type: object description: Emitted when an error occurs. properties: type: type: string description: 'The type of the event. Always `error`. ' enum: - error code: type: string description: 'The error code. ' nullable: true message: type: string description: 'The error message. ' param: type: string description: 'The error parameter. ' nullable: true sequence_number: type: integer description: The sequence number of this event. required: - type - code - message - param - sequence_number ResponseFileSearchCallCompletedEvent: type: object description: Emitted when a file search call is completed (results found). properties: type: type: string description: 'The type of the event. Always `response.file_search_call.completed`. ' enum: - response.file_search_call.completed output_index: type: 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: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number ResponseFileSearchCallInProgressEvent: type: object description: Emitted when a file search call is initiated. properties: type: type: string description: 'The type of the event. Always `response.file_search_call.in_progress`. ' enum: - response.file_search_call.in_progress output_index: type: 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: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number ResponseFileSearchCallSearchingEvent: type: object description: Emitted when a file search is currently searching. properties: type: type: string description: 'The type of the event. Always `response.file_search_call.searching`. ' enum: - response.file_search_call.searching output_index: type: 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: type: integer description: The sequence number of this event. required: - type - output_index - item_id - sequence_number ResponseFunctionCallArgumentsDeltaEvent: type: object description: Emitted when there is a partial function-call arguments delta. properties: type: type: string description: 'The type of the event. Always `response.function_call_arguments.delta`. ' enum: - response.function_call_arguments.delta item_id: type: string description: 'The ID of the output item that the function-call arguments delta is added to. ' output_index: type: integer description: 'The index of the output item that the function-call arguments delta is added to. ' sequence_number: type: integer description: The sequence number of this event. delta: type: string description: 'The function-call arguments delta that is added. ' required: - type - item_id - output_index - delta - sequence_number ResponseFunctionCallArgumentsDoneEvent: type: object description: Emitted when function-call arguments are finalized. properties: type: type: string enum: - response.function_call_arguments.done item_id: type: string description: The ID of the item. name: type: string description: The name of the function that was called. output_index: type: integer description: The index of the output item. sequence_number: type: integer description: The sequence number of this event. arguments: type: string description: The function-call arguments. required: - type - item_id - name - output_index - arguments - sequence_number ResponseInProgressEvent: type: object description: Emitted when the response is in progress. properties: type: type: string description: 'The type of the event. Always `response.in_progress`. ' enum: - response.in_progress response: $ref: '#/components/schemas/Response' description: 'The response that is in progress. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response - sequence_number ResponseFailedEvent: type: object description: 'An event that is emitted when a response fails. ' properties: type: type: string description: 'The type of the event. Always `response.failed`. ' enum: - response.failed sequence_number: type: integer description: The sequence number of this event. response: $ref: '#/components/schemas/Response' description: 'The response that failed. ' required: - type - response - sequence_number ResponseIncompleteEvent: type: object description: 'An event that is emitted when a response finishes as incomplete. ' properties: type: type: string description: 'The type of the event. Always `response.incomplete`. ' enum: - response.incomplete response: $ref: '#/components/schemas/Response' description: 'The response that was incomplete. ' sequence_number: type: integer description: The sequence number of this event. required: - type - response - sequence_number ResponseOutputItemAddedEvent: type: object description: Emitted when a new output item is added. properties: type: type: string description: 'The type of the event. Always `response.output_item.added`. ' enum: - response.output_item.added output_index: type: integer description: 'The index of the output item that was added. ' sequence_number: type: integer description: 'The sequence number of this event. ' item: $ref: '#/components/schemas/OutputItem' description: 'The output item that was added. ' required: - type - output_index - item - sequence_number ResponseOutputItemDoneEvent: type: object description: Emitted when an output item is marked done. properties: type: type: string description: 'The type of the event. Always `response.output_item.done`. ' enum: - response.output_item.done output_index: type: integer description: 'The index of the output item that was marked done. ' sequence_number: type: integer description: 'The sequence number of this event. ' item: $ref: '#/components/schemas/OutputItem' description: 'The output item that was marked done. ' required: - type - output_index - item - sequence_number ResponseReasoningSummaryPartAddedEvent: type: object description: Emitted when a new reasoning summary part is added. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_part.added`. ' enum: - response.reasoning_summary_part.added item_id: type: string description: 'The ID of the item this summary part is associated with. ' output_index: type: integer description: 'The index of the output item this summary part is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' sequence_number: type: integer description: 'The sequence number of this event. ' part: type: object description: 'The summary part that was added. ' properties: type: type: string description: The type of the summary part. Always `summary_text`. enum: - summary_text text: type: string description: The text of the summary part. required: - type - text required: - type - item_id - output_index - summary_index - part - sequence_number ResponseReasoningSummaryPartDoneEvent: type: object description: Emitted when a reasoning summary part is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_part.done`. ' enum: - response.reasoning_summary_part.done item_id: type: string description: 'The ID of the item this summary part is associated with. ' output_index: type: integer description: 'The index of the output item this summary part is associated with. ' summary_index: type: integer description: 'The index of the summary part within the reasoning summary. ' sequence_number: type: integer description: 'The sequence number of this event. ' part: type: object description: 'The completed summary part. ' properties: type: type: string description: The type of the summary part. Always `summary_text`. enum: - summary_text text: type: string description: The text of the summary part. required: - type - text required: - type - item_id - output_index - summary_index - part - sequence_number ResponseReasoningSummaryTextDeltaEvent: type: object description: Emitted when a delta is added to a reasoning summary text. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_text.delta`. ' enum: - response.reasoning_summary_text.delta item_id: type: string description: 'The ID of the item this summary text delta is associated with. ' output_index: type: integer description: 'The index of the output item this summary text delta is associated with. ' summary_index: type: 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: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - summary_index - delta - sequence_number ResponseReasoningSummaryTextDoneEvent: type: object description: Emitted when a reasoning summary text is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_summary_text.done`. ' enum: - response.reasoning_summary_text.done item_id: type: string description: 'The ID of the item this summary text is associated with. ' output_index: type: integer description: 'The index of the output item this summary text is associated with. ' summary_index: type: 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: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - summary_index - text - sequence_number ResponseReasoningTextDeltaEvent: type: object description: Emitted when a delta is added to a reasoning text. properties: type: type: string description: 'The type of the event. Always `response.reasoning_text.delta`. ' enum: - response.reasoning_text.delta item_id: type: string description: 'The ID of the item this reasoning text delta is associated with. ' output_index: type: integer description: 'The index of the output item this reasoning text delta is associated with. ' content_index: type: 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: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - delta - sequence_number ResponseReasoningTextDoneEvent: type: object description: Emitted when a reasoning text is completed. properties: type: type: string description: 'The type of the event. Always `response.reasoning_text.done`. ' enum: - response.reasoning_text.done item_id: type: string description: 'The ID of the item this reasoning text is associated with. ' output_index: type: integer description: 'The index of the output item this reasoning text is associated with. ' content_index: type: integer description: 'The index of the reasoning content part. ' text: type: string description: 'The full text of the completed reasoning content. ' sequence_number: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - text - sequence_number ResponseRefusalDeltaEvent: type: object description: Emitted when there is a partial refusal text. properties: type: type: string description: 'The type of the event. Always `response.refusal.delta`. ' enum: - response.refusal.delta item_id: type: string description: 'The ID of the output item that the refusal text is added to. ' output_index: type: integer description: 'The index of the output item that the refusal text is added to. ' content_index: type: 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: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - delta - sequence_number ResponseRefusalDoneEvent: type: object description: Emitted when refusal text is finalized. properties: type: type: string description: 'The type of the event. Always `response.refusal.done`. ' enum: - response.refusal.done item_id: type: string description: 'The ID of the output item that the refusal text is finalized. ' output_index: type: integer description: 'The index of the output item that the refusal text is finalized. ' content_index: type: 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: type: integer description: 'The sequence number of this event. ' required: - type - item_id - output_index - content_index - refusal - sequence_number ResponseTextDeltaEvent: type: object description: Emitted when there is an additional text delta. properties: type: type: string description: 'The type of the event. Always `response.output_text.delta`. ' enum: - response.output_text.delta item_id: type: string description: 'The ID of the output item that the text delta was added to. ' output_index: type: integer description: 'The index of the output item that the text delta was added to. ' content_index: type: 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: type: integer description: The sequence number for this event. logprobs: type: array description: 'The log probabilities of the tokens in the delta. ' items: $ref: '#/components/schemas/ResponseLogProb' required: - type - item_id - output_index - content_index - delta - sequence_number - logprobs ResponseLogProb: type: object 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.\n" properties: token: description: A possible text token. type: string logprob: description: 'The log probability of this token. ' type: number top_logprobs: description: 'The log probability of the top 20 most likely tokens. ' type: array items: type: object properties: token: description: A possible text token. type: string logprob: description: The log probability of this token. type: number required: - token - logprob ResponseTextDoneEvent: type: object description: Emitted when text content is finalized. properties: type: type: string description: 'The type of the event. Always `response.output_text.done`. ' enum: - response.output_text.done item_id: type: string description: 'The ID of the output item that the text content is finalized. ' output_index: type: integer description: 'The index of the output item that the text content is finalized. ' content_index: type: 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: type: integer description: The sequence number for this event. logprobs: type: array description: 'The log probabilities of the tokens in the delta. ' items: $ref: '#/components/schemas/ResponseLogProb' required: - type - item_id - output_index - content_index - text - sequence_number - logprobs ResponseWebSearchCallCompletedEvent: type: object description: Emitted when a web search call is completed. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.completed`. ' enum: - response.web_search_call.completed output_index: type: 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: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number ResponseWebSearchCallInProgressEvent: type: object description: Emitted when a web search call is initiated. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.in_progress`. ' enum: - response.web_search_call.in_progress output_index: type: 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: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number ResponseWebSearchCallSearchingEvent: type: object description: Emitted when a web search call is executing. properties: type: type: string description: 'The type of the event. Always `response.web_search_call.searching`. ' enum: - response.web_search_call.searching output_index: type: 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: type: integer description: The sequence number of the web search call being processed. required: - type - output_index - item_id - sequence_number ResponseImageGenCallCompletedEvent: type: object title: ResponseImageGenCallCompletedEvent description: 'Emitted when an image generation tool call has completed and the final image is available. ' properties: type: type: string enum: - response.image_generation_call.completed description: The type of the event. Always 'response.image_generation_call.completed'. output_index: type: integer description: The index of the output item in the response's output array. sequence_number: type: integer description: The sequence number of this event. item_id: type: string description: The unique identifier of the image generation item being processed. required: - type - output_index - item_id - sequence_number ResponseImageGenCallGeneratingEvent: type: object title: ResponseImageGenCallGeneratingEvent description: 'Emitted when an image generation tool call is actively generating an image (intermediate state). ' properties: type: type: string enum: - response.image_generation_call.generating description: The type of the event. Always 'response.image_generation_call.generating'. output_index: type: 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: type: integer description: The sequence number of the image generation item being processed. required: - type - output_index - item_id - sequence_number ResponseImageGenCallInProgressEvent: type: object title: ResponseImageGenCallInProgressEvent description: 'Emitted when an image generation tool call is in progress. ' properties: type: type: string enum: - response.image_generation_call.in_progress description: The type of the event. Always 'response.image_generation_call.in_progress'. output_index: type: 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: type: integer description: The sequence number of the image generation item being processed. required: - type - output_index - item_id - sequence_number ResponseImageGenCallPartialImageEvent: type: object title: ResponseImageGenCallPartialImageEvent description: 'Emitted when a partial image is available during image generation streaming. ' properties: type: type: string enum: - response.image_generation_call.partial_image description: The type of the event. Always 'response.image_generation_call.partial_image'. output_index: type: 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: type: integer description: The sequence number of the image generation item being processed. partial_image_index: type: 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. required: - type - output_index - item_id - sequence_number - partial_image_index - partial_image_b64 ResponseMCPCallArgumentsDeltaEvent: type: object title: ResponseMCPCallArgumentsDeltaEvent description: 'Emitted when there is a delta (partial update) to the arguments of an MCP tool call. ' properties: type: type: string enum: - response.mcp_call_arguments.delta description: The type of the event. Always 'response.mcp_call_arguments.delta'. output_index: type: 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: type: integer description: The sequence number of this event. required: - type - output_index - item_id - delta - sequence_number ResponseMCPCallArgumentsDoneEvent: type: object title: ResponseMCPCallArgumentsDoneEvent description: 'Emitted when the arguments for an MCP tool call are finalized. ' properties: type: type: string enum: - response.mcp_call_arguments.done description: The type of the event. Always 'response.mcp_call_arguments.done'. output_index: type: 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: type: integer description: The sequence number of this event. required: - type - output_index - item_id - arguments - sequence_number ResponseMCPCallCompletedEvent: type: object title: ResponseMCPCallCompletedEvent description: 'Emitted when an MCP tool call has completed successfully. ' properties: type: type: string enum: - response.mcp_call.completed description: The type of the event. Always 'response.mcp_call.completed'. item_id: type: string description: The ID of the MCP tool call item that completed. output_index: type: integer description: The index of the output item that completed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number ResponseMCPCallFailedEvent: type: object title: ResponseMCPCallFailedEvent description: 'Emitted when an MCP tool call has failed. ' properties: type: type: string enum: - response.mcp_call.failed description: The type of the event. Always 'response.mcp_call.failed'. item_id: type: string description: The ID of the MCP tool call item that failed. output_index: type: integer description: The index of the output item that failed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number ResponseMCPCallInProgressEvent: type: object title: ResponseMCPCallInProgressEvent description: 'Emitted when an MCP tool call is in progress. ' properties: type: type: string enum: - response.mcp_call.in_progress description: The type of the event. Always 'response.mcp_call.in_progress'. sequence_number: type: integer description: The sequence number of this event. output_index: type: 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. required: - type - output_index - item_id - sequence_number ResponseMCPListToolsCompletedEvent: type: object title: ResponseMCPListToolsCompletedEvent description: 'Emitted when the list of available MCP tools has been successfully retrieved. ' properties: type: type: string enum: - response.mcp_list_tools.completed description: The type of the event. Always 'response.mcp_list_tools.completed'. item_id: type: string description: The ID of the MCP tool call item that produced this output. output_index: type: integer description: The index of the output item that was processed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number ResponseMCPListToolsFailedEvent: type: object title: ResponseMCPListToolsFailedEvent description: 'Emitted when the attempt to list available MCP tools has failed. ' properties: type: type: string enum: - response.mcp_list_tools.failed description: The type of the event. Always 'response.mcp_list_tools.failed'. item_id: type: string description: The ID of the MCP tool call item that failed. output_index: type: integer description: The index of the output item that failed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number ResponseMCPListToolsInProgressEvent: type: object title: ResponseMCPListToolsInProgressEvent description: 'Emitted when the system is in the process of retrieving the list of available MCP tools. ' properties: type: type: string enum: - response.mcp_list_tools.in_progress description: The type of the event. Always 'response.mcp_list_tools.in_progress'. item_id: type: string description: The ID of the MCP tool call item that is being processed. output_index: type: integer description: The index of the output item that is being processed. sequence_number: type: integer description: The sequence number of this event. required: - type - item_id - output_index - sequence_number ResponseOutputTextAnnotationAddedEvent: type: object title: ResponseOutputTextAnnotationAddedEvent description: 'Emitted when an annotation is added to output text content. ' properties: type: type: string enum: - response.output_text.annotation.added description: The type of the event. Always 'response.output_text.annotation.added'. item_id: type: string description: The unique identifier of the item to which the annotation is being added. output_index: type: integer description: The index of the output item in the response's output array. content_index: type: integer description: The index of the content part within the output item. annotation_index: type: integer description: The index of the annotation within the content part. sequence_number: type: integer description: The sequence number of this event. annotation: type: object description: The annotation object being added. (See annotation schema for details.) required: - type - item_id - output_index - content_index - annotation_index - annotation - sequence_number ResponseQueuedEvent: type: object title: ResponseQueuedEvent description: 'Emitted when a response is queued and waiting to be processed. ' properties: type: type: string enum: - response.queued description: The type of the event. Always 'response.queued'. response: $ref: '#/components/schemas/Response' description: The full response object that is queued. sequence_number: type: integer description: The sequence number for this event. required: - type - response - sequence_number ResponseCustomToolCallInputDeltaEvent: title: ResponseCustomToolCallInputDelta type: object description: 'Event representing a delta (partial update) to the input of a custom tool call. ' properties: type: type: string enum: - response.custom_tool_call_input.delta description: The event type identifier. sequence_number: type: integer description: The sequence number of this event. output_index: type: 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. required: - type - output_index - item_id - delta - sequence_number ResponseCustomToolCallInputDoneEvent: title: ResponseCustomToolCallInputDone type: object description: 'Event indicating that input for a custom tool call is complete. ' properties: type: type: string enum: - response.custom_tool_call_input.done description: The event type identifier. sequence_number: type: integer description: The sequence number of this event. output_index: type: 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. required: - type - output_index - item_id - input - sequence_number Error: type: object properties: code: type: string nullable: true message: type: string param: type: string nullable: true type: type: string required: - type - message - param - code ResponseItemList: type: object description: A list of Response items. properties: object: description: The type of object returned, must be `list`. const: list data: type: array description: A list of items used to generate this response. items: $ref: '#/components/schemas/ItemResource' 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. required: - object - data - has_more - first_id - last_id ItemResource: description: 'Content item used to generate a response. ' discriminator: propertyName: type properties: type: type: string description: The type of the input item. required: - type anyOf: - $ref: '#/components/schemas/InputMessageResource' - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/FileSearchToolCall' - $ref: '#/components/schemas/ComputerToolCall' - $ref: '#/components/schemas/ComputerToolCallOutputResource' - $ref: '#/components/schemas/WebSearchToolCall' - $ref: '#/components/schemas/FunctionToolCallResource' - $ref: '#/components/schemas/FunctionToolCallOutputResource' - $ref: '#/components/schemas/ImageGenToolCall' - $ref: '#/components/schemas/CodeInterpreterToolCall' - $ref: '#/components/schemas/LocalShellToolCall' - $ref: '#/components/schemas/LocalShellToolCallOutput' - $ref: '#/components/schemas/FunctionShellCall' - $ref: '#/components/schemas/FunctionShellCallOutput' - $ref: '#/components/schemas/ApplyPatchToolCall' - $ref: '#/components/schemas/ApplyPatchToolCallOutput' - $ref: '#/components/schemas/MCPListTools' - $ref: '#/components/schemas/MCPApprovalRequest' - $ref: '#/components/schemas/MCPApprovalResponseResource' - $ref: '#/components/schemas/MCPToolCall' InputMessageResource: allOf: - $ref: '#/components/schemas/responses_InputMessage' - type: object properties: id: type: string description: 'The unique ID of the message input. ' required: - id ComputerToolCallOutputResource: allOf: - $ref: '#/components/schemas/ComputerToolCallOutput' - type: object properties: id: type: string description: 'The unique ID of the computer call tool output. ' required: - id ComputerToolCallOutput: type: object title: Computer tool call output description: 'The output of a computer tool call. ' properties: type: type: string description: 'The type of the computer tool call output. Always `computer_call_output`. ' enum: - computer_call_output default: computer_call_output id: type: string description: 'The ID of the computer tool call output. ' call_id: type: string description: 'The ID of the computer tool call that produced the output. ' acknowledged_safety_checks: type: array description: 'The safety checks reported by the API that have been acknowledged by the developer. ' items: $ref: '#/components/schemas/ComputerCallSafetyCheckParam' output: $ref: '#/components/schemas/ComputerScreenshotImage' status: type: string description: 'The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - call_id - output FunctionToolCallResource: allOf: - $ref: '#/components/schemas/FunctionToolCall' - type: object properties: id: type: string description: 'The unique ID of the function tool call. ' required: - id FunctionToolCallOutputResource: allOf: - $ref: '#/components/schemas/FunctionToolCallOutput' - type: object properties: id: type: string description: 'The unique ID of the function call tool output. ' required: - id FunctionToolCallOutput: type: object title: Function tool call output description: 'The output of a function tool call. ' properties: id: type: string description: 'The unique ID of the function tool call output. Populated when this item is returned via API. ' type: type: string enum: - function_call_output description: 'The type of the function tool call output. Always `function_call_output`. ' call_id: type: string description: 'The unique ID of the function tool call generated by the model. ' output: description: 'The output from the function call generated by your code. Can be a string or an list of output content. ' anyOf: - type: string description: 'A string of the output of the function call. ' title: string output - type: array items: $ref: '#/components/schemas/FunctionAndCustomToolCallOutput' title: output content list description: 'Text, image, or file output of the function call. ' status: type: string description: 'The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. ' enum: - in_progress - completed - incomplete required: - type - call_id - output MCPApprovalResponseResource: type: object title: MCP approval response description: 'A response to an MCP approval request. ' properties: type: type: string enum: - mcp_approval_response description: 'The type of the item. Always `mcp_approval_response`. ' 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: type: string description: 'Optional reason for the decision. ' nullable: true required: - type - id - request_id - approve - approval_request_id CompactResponseMethodPublicBody: properties: model: $ref: '#/components/schemas/ModelIdsCompaction' input: description: Text, image, or file inputs to the model, used to generate a response anyOf: - type: string maxLength: 10485760 description: A text input to the model, equivalent to a text input with the `user` role. - items: $ref: '#/components/schemas/InputItem' type: array nullable: true previous_response_id: type: string description: The unique ID of the previous response to the model. Use this to create multi-turn conversations. nullable: true instructions: type: string description: 'A system (or developer) message inserted into the model''s context. When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.' nullable: true type: object required: [] ModelIdsCompaction: type: string description: Model ID used to generate the response, like `gpt-5` or `o3`. CompactResource: 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`. default: response.compaction output: type: array description: The compacted list of output items. This is a list of all user messages, followed by a single compaction item. items: $ref: '#/components/schemas/OutputItem' created_at: type: integer description: Unix timestamp (in seconds) when the compacted conversation was created. usage: $ref: '#/components/schemas/ResponseUsage' description: Token accounting for the compaction pass, including cached, reasoning, and total tokens. type: object required: - id - object - output - created_at - usage title: The compacted response object TokenCountsBody: properties: model: type: string description: Model ID used to generate the response, like `gpt-4o` or `o3`. nullable: true input: description: Text, image, or file inputs to the model, used to generate a response anyOf: - type: string maxLength: 10485760 description: A text input to the model, equivalent to a text input with the `user` role. - items: $ref: '#/components/schemas/InputItem' type: array nullable: true previous_response_id: type: string description: The unique ID of the previous response to the model. Use this to create multi-turn conversations. nullable: true tools: items: $ref: '#/components/schemas/responses_Tool' type: array 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. nullable: true text: $ref: '#/components/schemas/ResponseTextParam' nullable: true reasoning: $ref: '#/components/schemas/Reasoning' description: '**gpt-5 and o-series models only**' nullable: true truncation: $ref: '#/components/schemas/TruncationEnum' description: 'The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model''s context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.' instructions: type: string description: 'A system (or developer) message inserted into the model''s context. When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.' nullable: true conversation: $ref: '#/components/schemas/ConversationParam' nullable: true tool_choice: $ref: '#/components/schemas/ToolChoiceParam' nullable: true parallel_tool_calls: type: boolean description: Whether to allow the model to run tool calls in parallel. nullable: true type: object required: [] TruncationEnum: type: string enum: - auto - disabled TokenCountsResource: properties: object: type: string enum: - response.input_tokens default: response.input_tokens input_tokens: type: integer type: object required: - object - input_tokens title: Token counts list_files_ListFilesResponse: type: object description: A list of uploaded files. properties: data: type: array items: $ref: '#/components/schemas/file_FileResponse' object: type: string enum: - list required: - data file_FileResponse: type: object description: The File object represents a document that has been uploaded to OpenAI. properties: bytes: type: integer description: The size of the file, in bytes. created_at: type: integer description: The Unix timestamp (in seconds) for when the file was created. filename: type: string description: The name of the file. id: type: string description: The file identifier, which can be referenced in the API endpoints. purpose: type: string description: The intended purpose of the file. enum: - assistants - assistants_output - batch - batch_output - fine-tune - fine-tune-results - vision status: type: string description: The status of the file. enum: - error - processed - uploaded object: type: string enum: - file upload_file_UploadFileRequest: type: object properties: file: type: string format: binary description: The File object (not file name) to be uploaded. purpose: $ref: '#/components/schemas/FilePurposeType' required: - file - purpose deletion_status_DeletionStatusResponse: type: object description: The status of a file deletion. properties: id: type: string description: The file identifier. deleted: type: boolean description: Indicates whether the file has been deleted. required: - id - deleted APIKeyRequest: type: object properties: name: type: string description: The name of the key (needs to be unique). minLength: 1 maxLength: 255 enabled: type: boolean description: Whether the API key is enabled. Only applicable when updating a key. expiration_date: type: string format: date-time nullable: true description: The date when the key expires. Null means no expiration. required: - name APIKeyBulkUpdateRequest: type: object properties: items: type: array items: $ref: '#/components/schemas/APIKeyBulkUpdateItem' maxItems: 100 required: - items APIKeyBulkUpdateItem: type: object properties: id: type: string format: uuid description: The UUID of the key to update. name: type: string description: The name of the key. minLength: 1 maxLength: 255 enabled: type: boolean description: Whether the API key is enabled. expiration_date: type: string format: date-time nullable: true description: The date when the key expires. remove: type: boolean description: If you want to remove api key, set this to true - other cases skip. required: - id