Пропустить и перейти к основному содержимому

Этот браузер больше не поддерживается.

Выполните обновление до Microsoft Edge, чтобы воспользоваться новейшими функциями, обновлениями для системы безопасности и технической поддержкой.

Скачать Microsoft Edge Дополнительные сведения об Internet Explorer и Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Containers

Create a container

POST /openai/v1/containers

Creates a container from the supplied request.

Текст запроса

The request body.

Content-Type: application/json
name string обязательно

Name of the container to create.

file_ids string[]

IDs of files to copy to the container.

expires_after OpenAI.CreateContainerBodyExpiresAfter
anchor enum обязательно
last_active_at
minutes integer обязательно
skills OpenAI.ContainerSkill[]

An optional list of skills referenced by id or inline data.

memory_limit enum

Optional memory limit for the container. Defaults to "1g".

1g4g16g64g
network_policy disabled | allowlist

Network access policy for the container.

Один из следующих:
disabled OpenAI.ContainerNetworkPolicyDisabledParam
type enum обязательно

Disable outbound network access. Always disabled.

disabled
allowlist OpenAI.ContainerNetworkPolicyAllowlistParam
type enum обязательно

Allow outbound network access only to specified domains. Always allowlist.

allowlist
allowed_domains string[] обязательно

A list of allowed domains when type is allowlist.

Ответы

The request has succeeded.

Текст

Content-Type: application/json
id string обязательно

Unique identifier for the container.

object string обязательно

The type of this object.

name string обязательно

Name of the container.

created_at integer обязательно

Unix timestamp (in seconds) when the container was created.

status string обязательно

Status of the container (e.g., active, deleted).

last_active_at integer

Unix timestamp (in seconds) when the container was last active.

expires_after OpenAI.ContainerResourceExpiresAfter
anchor enum
last_active_at
minutes integer
memory_limit enum

The memory limit configured for the container.

1g4g16g64g
network_policy disabled | allowlist

Network access policy for the container.

Один из следующих:
disabled OpenAI.ContainerNetworkPolicyDisabledParam
type enum обязательно

Disable outbound network access. Always disabled.

disabled
allowlist OpenAI.ContainerNetworkPolicyAllowlistParam
type enum обязательно

Allow outbound network access only to specified domains. Always allowlist.

allowlist
allowed_domains string[] обязательно

A list of allowed domains when type is allowlist.

Client error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Запрос

curl https://api.openai.com/v1/containers \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "My Container",
        "memory_limit": "4g",
        "skills": [
          {
            "type": "skill_reference",
            "skill_id": "skill_4db6f1a2c9e73508b41f9da06e2c7b5f"
          },
          {
            "type": "skill_reference",
            "skill_id": "openai-spreadsheets",
            "version": "latest"
          }
        ],
        "network_policy": {
          "type": "allowlist",
          "allowed_domains": ["api.buildkite.com"]
        }
      }'
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);
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
container = client.containers.create(
    name="name",
)
print(container.id)
package main

import (
    "context"
    "fmt"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    container, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{
        Name: "name",
    })
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", container.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.containers.ContainerCreateParams;
import com.openai.models.containers.ContainerCreateResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        ContainerCreateParams params = ContainerCreateParams.builder()
            .name("name")
            .build();
        ContainerCreateResponse container = client.containers().create(params);
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

container = openai.containers.create(name: "name")

puts(container)

Response

{
    "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"
}
ru-ru
Ваши варианты выбора параметров конфиденциальности
  • Заявление об отказе ИИ
  • Предыдущие версии
  • Блог
  • Участие в доработке
  • Конфиденциальность
  • Конфиденциальность медицинских данных потребителей
  • Условия использования
  • Товарные знаки
  • © Microsoft 2026