Create container
client.containers.create(ContainerCreateParams { name, expires_after, file_ids, 3 more } body, RequestOptionsoptions?): ContainerCreateResponse { id, created_at, name, 6 more }
POST/containers
Create container
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const container = await client.containers.create({ name: 'name' });
console.log(container.id);{
"id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",
"object": "container",
"created_at": 1747857508,
"status": "running",
"expires_after": {
"anchor": "last_active_at",
"minutes": 20
},
"last_active_at": 1747857508,
"network_policy": {
"type": "allowlist",
"allowed_domains": ["api.buildkite.com"]
},
"memory_limit": "4g",
"name": "My Container"
}
Returns Examples
{
"id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",
"object": "container",
"created_at": 1747857508,
"status": "running",
"expires_after": {
"anchor": "last_active_at",
"minutes": 20
},
"last_active_at": 1747857508,
"network_policy": {
"type": "allowlist",
"allowed_domains": ["api.buildkite.com"]
},
"memory_limit": "4g",
"name": "My Container"
}