SPB Git

Repository Public

create.md 5.9 KB 292 lines markdown

1> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.23## Create container45**post** `/containers`67Create Container89### Body Parameters1011- `name: string`1213  Name of the container to create.1415- `expires_after: optional object { anchor, minutes }`1617  Container expiration time in seconds relative to the 'anchor' time.1819  - `anchor: "last_active_at"`2021    Time anchor for the expiration time. Currently only 'last_active_at' is supported.2223    - `"last_active_at"`2425  - `minutes: number`2627- `file_ids: optional array of string`2829  IDs of files to copy to the container.3031- `memory_limit: optional "1g" or "4g" or "16g" or "64g"`3233  Optional memory limit for the container. Defaults to "1g".3435  - `"1g"`3637  - `"4g"`3839  - `"16g"`4041  - `"64g"`4243- `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`4445  Network access policy for the container.4647  - `ContainerNetworkPolicyDisabled object { type }`4849    - `type: "disabled"`5051      Disable outbound network access. Always `disabled`.5253      - `"disabled"`5455  - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`5657    - `allowed_domains: array of string`5859      A list of allowed domains when type is `allowlist`.6061    - `type: "allowlist"`6263      Allow outbound network access only to specified domains. Always `allowlist`.6465      - `"allowlist"`6667    - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret`6869      Optional domain-scoped secrets for allowlisted domains.7071      - `domain: string`7273        The domain associated with the secret.7475      - `name: string`7677        The name of the secret to inject for the domain.7879      - `value: string`8081        The secret value to inject for the domain.8283- `skills: optional array of SkillReference or InlineSkill`8485  An optional list of skills referenced by id or inline data.8687  - `SkillReference object { skill_id, type, version }`8889    - `skill_id: string`9091      The ID of the referenced skill.9293    - `type: "skill_reference"`9495      References a skill created with the /v1/skills endpoint.9697      - `"skill_reference"`9899    - `version: optional string`100101      Optional skill version. Use a positive integer or 'latest'. Omit for default.102103  - `InlineSkill object { description, name, source, type }`104105    - `description: string`106107      The description of the skill.108109    - `name: string`110111      The name of the skill.112113    - `source: InlineSkillSource`114115      Inline skill payload116117      - `data: string`118119        Base64-encoded skill zip bundle.120121      - `media_type: "application/zip"`122123        The media type of the inline skill payload. Must be `application/zip`.124125        - `"application/zip"`126127      - `type: "base64"`128129        The type of the inline skill source. Must be `base64`.130131        - `"base64"`132133    - `type: "inline"`134135      Defines an inline skill for this request.136137      - `"inline"`138139### Returns140141- `id: string`142143  Unique identifier for the container.144145- `created_at: number`146147  Unix timestamp (in seconds) when the container was created.148149- `name: string`150151  Name of the container.152153- `object: string`154155  The type of this object.156157- `status: string`158159  Status of the container (e.g., active, deleted).160161- `expires_after: optional object { anchor, minutes }`162163  The container will expire after this time period.164  The anchor is the reference point for the expiration.165  The minutes is the number of minutes after the anchor before the container expires.166167  - `anchor: optional "last_active_at"`168169    The reference point for the expiration.170171    - `"last_active_at"`172173  - `minutes: optional number`174175    The number of minutes after the anchor before the container expires.176177- `last_active_at: optional number`178179  Unix timestamp (in seconds) when the container was last active.180181- `memory_limit: optional "1g" or "4g" or "16g" or "64g"`182183  The memory limit configured for the container.184185  - `"1g"`186187  - `"4g"`188189  - `"16g"`190191  - `"64g"`192193- `network_policy: optional object { type, allowed_domains }`194195  Network access policy for the container.196197  - `type: "allowlist" or "disabled"`198199    The network policy mode.200201    - `"allowlist"`202203    - `"disabled"`204205  - `allowed_domains: optional array of string`206207    Allowed outbound domains when `type` is `allowlist`.208209### Example210211```http212curl https://api.openai.com/v1/containers \213    -H 'Content-Type: application/json' \214    -H "Authorization: Bearer $OPENAI_API_KEY" \215    -d '{216          "name": "name"217        }'218```219220#### Response221222```json223{224  "id": "id",225  "created_at": 0,226  "name": "name",227  "object": "object",228  "status": "status",229  "expires_after": {230    "anchor": "last_active_at",231    "minutes": 0232  },233  "last_active_at": 0,234  "memory_limit": "1g",235  "network_policy": {236    "type": "allowlist",237    "allowed_domains": [238      "string"239    ]240  }241}242```243244### Example245246```http247curl https://api.openai.com/v1/containers \248  -H "Authorization: Bearer $OPENAI_API_KEY" \249  -H "Content-Type: application/json" \250  -d '{251        "name": "My Container",252        "memory_limit": "4g",253        "skills": [254          {255            "type": "skill_reference",256            "skill_id": "skill_4db6f1a2c9e73508b41f9da06e2c7b5f"257          },258          {259            "type": "skill_reference",260            "skill_id": "openai-spreadsheets",261            "version": "latest"262          }263        ],264        "network_policy": {265          "type": "allowlist",266          "allowed_domains": ["api.buildkite.com"]267        }268      }'269```270271#### Response272273```json274{275    "id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",276    "object": "container",277    "created_at": 1747857508,278    "status": "running",279    "expires_after": {280        "anchor": "last_active_at",281        "minutes": 20282    },283    "last_active_at": 1747857508,284    "network_policy": {285        "type": "allowlist",286        "allowed_domains": ["api.buildkite.com"]287    },288    "memory_limit": "4g",289    "name": "My Container"290}291```292
Files main
Menu

Theme