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.
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.
Authentication
You can access OCI OpenAI-compatible endpoints in two ways:
Use API keys for testing and early development. Use IAM-based authentication for production workloads and OCI-managed environments.
Creating a Container
POST /containers
- Reference
-
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
-
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
-
Example:
# retrieve container container = client.containers.retrieve( "container_id", ) print(container.id) - OCI Limitations
- None
Deleting a Container
DELETE /containers/{container_id}
- Reference
-
Example:
# delete container client.containers.delete( "container_id", ) - OCI Limitations
- None