containers
Creates, updates, deletes, gets or lists a containers resource.
Overview
| Name | containers |
| Type | Resource |
| Id | openai.containers.containers |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the container. |
name | string | Name of the container. |
created_at | integer (unixtime) | Unix timestamp (in seconds) when the container was created. |
expires_after | object | The container will expire after this time period. The anchor is the reference point for the expiration. The minutes is the number of minutes after the anchor before the container expires. |
last_active_at | integer (unixtime) | Unix timestamp (in seconds) when the container was last active. |
memory_limit | string | The memory limit configured for the container. (1g, 4g, 16g, 64g) |
network_policy | object | Network access policy for the container. |
object | string | The type of this object. |
status | string | Status of the container (e.g., active, deleted). |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the container. |
name | string | Name of the container. |
created_at | integer (unixtime) | Unix timestamp (in seconds) when the container was created. |
expires_after | object | The container will expire after this time period. The anchor is the reference point for the expiration. The minutes is the number of minutes after the anchor before the container expires. |
last_active_at | integer (unixtime) | Unix timestamp (in seconds) when the container was last active. |
memory_limit | string | The memory limit configured for the container. (1g, 4g, 16g, 64g) |
network_policy | object | Network access policy for the container. |
object | string | The type of this object. |
status | string | Status of the container (e.g., active, deleted). |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | container_id | openai-organization, openai-project | Retrieves a container. |
list | select | limit, order, after, name, openai-organization, openai-project | Lists containers. | |
create | insert | name | openai-organization, openai-project | Creates a container. |
delete | delete | container_id | openai-organization, openai-project | Delete a container. |
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 |
|---|---|---|
container_id | string | The ID of the container to delete. |
after | string | A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. |
limit | 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. |
name | string | Filter results by container name. |
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 | Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. |
SELECT examples
- get
- list
Retrieves a container.
SELECT
id,
name,
created_at,
expires_after,
last_active_at,
memory_limit,
network_policy,
object,
status
FROM openai.containers.containers
WHERE container_id = '{{ container_id }}' -- required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;
Lists containers.
SELECT
id,
name,
created_at,
expires_after,
last_active_at,
memory_limit,
network_policy,
object,
status
FROM openai.containers.containers
WHERE "order" = '{{ order }}'
AND after = '{{ after }}'
AND name = '{{ name }}'
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;
INSERT examples
- create
- Manifest
Creates a container.
INSERT INTO openai.containers.containers (
name,
file_ids,
expires_after,
skills,
memory_limit,
network_policy,
"openai-organization",
"openai-project"
)
SELECT
'{{ name }}' /* required */,
'{{ file_ids }}',
'{{ expires_after }}',
'{{ skills }}',
'{{ memory_limit }}',
'{{ network_policy }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
name,
created_at,
expires_after,
last_active_at,
memory_limit,
network_policy,
object,
status
;
# Description fields are for documentation purposes
- name: containers
props:
- name: name
value: "{{ name }}"
description: |
Name of the container to create.
- name: file_ids
value:
- "{{ file_ids }}"
description: |
IDs of files to copy to the container.
- name: expires_after
description: |
Container expiration time in seconds relative to the 'anchor' time.
value:
anchor: "{{ anchor }}"
minutes: {{ minutes }}
- name: skills
value: "{{ skills }}"
description: |
An optional list of skills referenced by id or inline data.
- name: memory_limit
value: "{{ memory_limit }}"
description: |
Optional memory limit for the container. Defaults to "1g".
valid_values: ['1g', '4g', '16g', '64g']
- name: network_policy
description: |
Network access policy for the container.
value:
type: "{{ type }}"
allowed_domains:
- "{{ allowed_domains }}"
domain_secrets:
- domain: "{{ domain }}"
name: "{{ name }}"
value: "{{ value }}"
- 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
Delete a container.
DELETE FROM openai.containers.containers
WHERE container_id = '{{ container_id }}' --required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;