microsoft-foundry.rest.security.o-auth2-auth
Containers
Delete a container
DELETE
/openai/v1/containers/{container_id}
Deletes a container by its identifier.
Параметры пути
container_id
string
обязательно
The ID of the container to delete.
Ответы
The request has succeeded.
Запрос
curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \
-H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
await client.containers.delete('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
)
client.containers.delete(
"container_id",
)
package main
import (
"context"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Containers.Delete(context.TODO(), "container_id")
if err != nil {
panic(err.Error())
}
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.containers.ContainerDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
client.containers().delete("container_id");
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
result = openai.containers.delete("container_id")
puts(result)
Response
{
"id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
"object": "container.deleted",
"deleted": true
}