Zu Hauptinhalt wechseln

Dieser Browser wird nicht mehr unterstützt.

Führen Sie ein Upgrade auf Microsoft Edge durch, um die neuesten Features, Sicherheitsupdates und den technischen Support zu nutzen.

Microsoft Edge herunterladen Weitere Informationen zu Internet Explorer und Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Containers

Create a container

POST /openai/v1/containers

Creates a container from the supplied request.

Anforderungstext

The request body.

Content-Type: application/json
name string Erforderlich

Name of the container to create.

file_ids string[]

IDs of files to copy to the container.

expires_after OpenAI.CreateContainerBodyExpiresAfter
anchor enum Erforderlich
last_active_at
minutes integer Erforderlich
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.

Eins der folgenden:
disabled OpenAI.ContainerNetworkPolicyDisabledParam
type enum Erforderlich

Disable outbound network access. Always disabled.

disabled
allowlist OpenAI.ContainerNetworkPolicyAllowlistParam
type enum Erforderlich

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

allowlist
allowed_domains string[] Erforderlich

A list of allowed domains when type is allowlist.

Antworten

The request has succeeded.

Text

Content-Type: application/json
id string Erforderlich

Unique identifier for the container.

object string Erforderlich

The type of this object.

name string Erforderlich

Name of the container.

created_at integer Erforderlich

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

status string Erforderlich

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.

Eins der folgenden:
disabled OpenAI.ContainerNetworkPolicyDisabledParam
type enum Erforderlich

Disable outbound network access. Always disabled.

disabled
allowlist OpenAI.ContainerNetworkPolicyAllowlistParam
type enum Erforderlich

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

allowlist
allowed_domains string[] Erforderlich

A list of allowed domains when type is allowlist.

Client error

Text

Content-Type: application/json
error OpenAI.Error Erforderlich
code string | null Erforderlich
message string Erforderlich
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Eines der folgenden Elemente:
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 Erforderlich

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Text

Content-Type: application/json
error OpenAI.Error Erforderlich
code string | null Erforderlich
message string Erforderlich
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Eines der folgenden Elemente:
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 Erforderlich

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Anfordern

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)

Antwort

{
    "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"
}
de-de
Ihre Datenschutzoptionen
  • KI-Haftungsausschluss
  • Frühere Versionen
  • Blog
  • Mitwirken
  • Datenschutz
  • Consumer Health Privacy
  • Nutzungsbedingungen
  • Impressum
  • Marken
  • © Microsoft 2026