Containers API

Use the Containers API for secure, stateful, isolated sandboxes for running code and shell commands (for example, Python) to process data.

This API supports multi-step, computation-heavy workflows, such as analysis, file upload and download, and generating artifacts, providing a managed place for agents to run code and apply programmatic logic to complete complex tasks.

Note

The OCI Containers API uses the same format as the OpenAI Files API with the OCI OpenAI-compatible endpoint. For syntax and request details, see the OpenAI Containers API documentation. For the properties that aren't supported, see the OCI Limitations sections on this page.

Supported API Endpoint

Base URL Endpoint Path Authentication
https://inference.generativeai.${region}.oci.oraclecloud.com/openai/v1 /containers API key or IAM session

Replace ${region} with a supported OCI region such as us-chicago-1.

Although the request format is OpenAI-compatible, authentication uses OCI credentials, requests are routed through OCI Generative AI inference endpoints, and resources and execution remain in OCI.

Tip

For steps to perform before using this API, see the QuickStart.

Creating a Container

POST /containers

Reference

Create container

Example:

# create container
container = client.containers.create(
    name="name",
)
print(container.id)
OCI Limitations
Note

Skills and Network Policies aren't supported.

Listing Containers

GET /containers

Reference

List containers

Example:

# list containers
page = client.containers.list()
page = page.data[0]
print(page.id)
OCI Limitations
None

Retrieving Container Information

GET /containers/{container_id}

Reference

Retrieve container

Example:

# retrieve container
container = client.containers.retrieve(
    "container_id",
)
print(container.id)
OCI Limitations
None

Deleting a Container

DELETE /containers/{container_id}

Reference

Delete container

Example:

# delete container
client.containers.delete(
    "container_id",
)
OCI Limitations
None