items
Creates, updates, deletes, gets or lists an items resource.
Overview
| Name | items |
| Type | Resource |
| Id | openai.conversations.items |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the message. |
name | string | The name of the function to run. |
approval_request_id | string | The ID of the approval request being answered. |
call_id | string | The unique ID of the function tool call generated by the model. |
container_id | string | The ID of the container used to run the code. |
acknowledged_safety_checks | array | The safety checks reported by the API that have been acknowledged by the developer. |
action | object | An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). (title: Search action) |
actions | array | Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields. (title: Computer Action List) |
approve | boolean | Whether the request was approved. |
arguments | string | A JSON string of the arguments to pass to the function. |
code | string | The code to run, or null if not available. |
content | array | The content of the message |
created_by | string | The identifier of the actor that created the item. |
encrypted_content | string | The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter. |
environment | string (json) | |
error | string | Error message if the server could not list tools. |
execution | string | Whether tool search was executed by the server or by the client. (server, client) |
input | string | The input for the custom tool call generated by the model. |
max_output_length | integer | The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. |
namespace | string | The namespace of the function to run. |
operation | object | One of the create_file, delete_file, or update_file operations applied via apply_patch. (title: Apply patch operation) |
output | string | The output from the function call generated by your code. Can be a string or an list of output content. (title: string output) |
outputs | array | The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available. |
pending_safety_checks | array | The pending safety checks for the computer call. |
phase | string | (commentary, final_answer) |
queries | array | The queries used to search for files. |
reason | string | Optional reason for the decision. |
result | string | The generated image encoded in base64. |
results | array | The results of the file search tool call. |
role | string | The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool. (unknown, user, assistant, system, critic, discriminator, developer, tool) |
server_label | string | The label of the MCP server. |
status | string | The status of item. One of in_progress, completed, or incomplete. Populated when items are returned via API. (in_progress, completed, incomplete) |
summary | array | Reasoning summary content. |
tools | array | The loaded tool definitions returned by tool search. |
type | string | The type of the message. Always set to message. (message) (default: message) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the message. |
name | string | The name of the function to run. |
approval_request_id | string | The ID of the approval request being answered. |
call_id | string | The unique ID of the function tool call generated by the model. |
container_id | string | The ID of the container used to run the code. |
acknowledged_safety_checks | array | The safety checks reported by the API that have been acknowledged by the developer. |
action | object | An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). (title: Search action) |
actions | array | Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields. (title: Computer Action List) |
approve | boolean | Whether the request was approved. |
arguments | string | A JSON string of the arguments to pass to the function. |
code | string | The code to run, or null if not available. |
content | array | The content of the message |
created_by | string | The identifier of the actor that created the item. |
encrypted_content | string | The encrypted content of the reasoning item - populated when a response is generated with reasoning.encrypted_content in the include parameter. |
environment | string (json) | |
error | string | Error message if the server could not list tools. |
execution | string | Whether tool search was executed by the server or by the client. (server, client) |
input | string | The input for the custom tool call generated by the model. |
max_output_length | integer | The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. |
namespace | string | The namespace of the function to run. |
operation | object | One of the create_file, delete_file, or update_file operations applied via apply_patch. (title: Apply patch operation) |
output | string | The output from the function call generated by your code. Can be a string or an list of output content. (title: string output) |
outputs | array | The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available. |
pending_safety_checks | array | The pending safety checks for the computer call. |
phase | string | (commentary, final_answer) |
queries | array | The queries used to search for files. |
reason | string | Optional reason for the decision. |
result | string | The generated image encoded in base64. |
results | array | The results of the file search tool call. |
role | string | The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool. (unknown, user, assistant, system, critic, discriminator, developer, tool) |
server_label | string | The label of the MCP server. |
status | string | The status of item. One of in_progress, completed, or incomplete. Populated when items are returned via API. (in_progress, completed, incomplete) |
summary | array | Reasoning summary content. |
tools | array | The loaded tool definitions returned by tool search. |
type | string | The type of the message. Always set to message. (message) (default: message) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | conversation_id, item_id | include, openai-organization, openai-project | |
list | select | conversation_id | limit, order, after, include, openai-organization, openai-project | |
create | insert | conversation_id, items | include, openai-organization, openai-project | |
delete | delete | conversation_id, item_id | openai-organization, openai-project |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
conversation_id | string | The ID of the conversation that contains the item. |
item_id | string | The ID of the item to delete. |
after | string | An item ID to list items after, used in pagination. |
include | array | Additional fields to include in the response. See the include parameter for listing Conversation items above for more information. |
limit | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Automatically applied from a SQL LIMIT clause - SELECT ... LIMIT 10 sends limit=10 on the wire. Setting it explicitly in a WHERE clause is not required. |
openai-organization | string | Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization. |
openai-project | string | Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project. |
order | string | 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. |
SELECT examples
- get
- list
OK
SELECT
id,
name,
approval_request_id,
call_id,
container_id,
acknowledged_safety_checks,
action,
actions,
approve,
arguments,
code,
content,
created_by,
encrypted_content,
environment,
error,
execution,
input,
max_output_length,
namespace,
operation,
output,
outputs,
pending_safety_checks,
phase,
queries,
reason,
result,
results,
role,
server_label,
status,
summary,
tools,
type
FROM openai.conversations.items
WHERE conversation_id = '{{ conversation_id }}' -- required
AND item_id = '{{ item_id }}' -- required
AND include = '{{ include }}'
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;
OK
SELECT
id,
name,
approval_request_id,
call_id,
container_id,
acknowledged_safety_checks,
action,
actions,
approve,
arguments,
code,
content,
created_by,
encrypted_content,
environment,
error,
execution,
input,
max_output_length,
namespace,
operation,
output,
outputs,
pending_safety_checks,
phase,
queries,
reason,
result,
results,
role,
server_label,
status,
summary,
tools,
type
FROM openai.conversations.items
WHERE conversation_id = '{{ conversation_id }}' -- required
AND "order" = '{{ order }}'
AND after = '{{ after }}'
AND include = '{{ include }}'
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;
INSERT examples
- create
- Manifest
No description available.
INSERT INTO openai.conversations.items (
items,
conversation_id,
include,
"openai-organization",
"openai-project"
)
SELECT
'{{ items }}' /* required */,
'{{ conversation_id }}',
'{{ include }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
first_id,
last_id,
data,
has_more,
object
;
# Description fields are for documentation purposes
- name: items
props:
- name: conversation_id
value: "{{ conversation_id }}"
description: Required parameter for the items resource.
- name: items
description: |
The items to add to the conversation. You may add up to 20 items at a time.
value:
- role: "{{ role }}"
content: "{{ content }}"
phase: "{{ phase }}"
type: "{{ type }}"
status: "{{ status }}"
id: "{{ id }}"
queries: "{{ queries }}"
results: "{{ results }}"
call_id: "{{ call_id }}"
action:
type: "{{ type }}"
button: "{{ button }}"
x: {{ x }}
y: {{ y }}
keys:
- "{{ keys }}"
path:
- x: {{ x }}
y: {{ y }}
scroll_x: {{ scroll_x }}
scroll_y: {{ scroll_y }}
text: "{{ text }}"
actions: "{{ actions }}"
pending_safety_checks: "{{ pending_safety_checks }}"
output:
type: "{{ type }}"
image_url: "{{ image_url }}"
file_id: "{{ file_id }}"
acknowledged_safety_checks: "{{ acknowledged_safety_checks }}"
namespace: "{{ namespace }}"
name: "{{ name }}"
arguments: "{{ arguments }}"
execution: "{{ execution }}"
tools: "{{ tools }}"
encrypted_content: "{{ encrypted_content }}"
summary: "{{ summary }}"
result: "{{ result }}"
container_id: "{{ container_id }}"
code: "{{ code }}"
outputs: "{{ outputs }}"
environment: "{{ environment }}"
max_output_length: {{ max_output_length }}
operation:
type: "{{ type }}"
path: "{{ path }}"
diff: "{{ diff }}"
server_label: "{{ server_label }}"
error: "{{ error }}"
approval_request_id: "{{ approval_request_id }}"
approve: {{ approve }}
reason: "{{ reason }}"
input: "{{ input }}"
- name: include
value: "{{ include }}"
description: Additional fields to include in the response. See the `include` parameter for [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include) for more information.
description: Additional fields to include in the response. See the `include` parameter for [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include) for more information.
- name: openai-organization
value: "{{ openai-organization }}"
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
- name: openai-project
value: "{{ openai-project }}"
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
DELETE examples
- delete
No description available.
DELETE FROM openai.conversations.items
WHERE conversation_id = '{{ conversation_id }}' --required
AND item_id = '{{ item_id }}' --required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;