跳到主要內容

已不再支援此瀏覽器。

請升級至 Microsoft Edge,以利用最新功能、安全性更新和技術支援。

下載 Microsoft Edge Internet Explorer 和 Microsoft Edge 的詳細資訊
microsoft-foundry.rest.security.o-auth2-auth

Assistants

Delete an assistant

DELETE /openai/v1/assistants/{assistant_id} 已被取代

Deletes an assistant by its identifier.

路徑參數

assistant_id string 必要 已被取代

The ID of the assistant to delete.

回覆

The request has succeeded.

主體

Content-Type: application/json
id string 必要 已被取代
deleted boolean 必要 已被取代
object enum 必要 已被取代
assistant.deleted

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[] 已被取代

Additional errors that contributed to this failure.

additionalInfo object 已被取代

Additional structured information about the failure.

debugInfo object 已被取代

Diagnostic information supplied by the service for troubleshooting.

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[] 已被取代

Additional errors that contributed to this failure.

additionalInfo object 已被取代

Additional structured information about the failure.

debugInfo object 已被取代

Diagnostic information supplied by the service for troubleshooting.

Request

curl https://api.openai.com/v1/assistants/asst_abc123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Beta: assistants=v2" \
  -X DELETE
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
assistant_deleted = client.beta.assistants.delete(
    "assistant_id",
)
print(assistant_deleted.id)
import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const response = await openai.beta.assistants.delete("asst_abc123");

  console.log(response);
}
main();
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const assistantDeleted = await client.beta.assistants.delete('assistant_id');

console.log(assistantDeleted.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"),
    )
    assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id")
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", assistantDeleted.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.assistants.AssistantDeleteParams;
import com.openai.models.beta.assistants.AssistantDeleted;

public final class Main {
    private Main() {}

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

        AssistantDeleted assistantDeleted = client.beta().assistants().delete("assistant_id");
    }
}
require "openai"

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

assistant_deleted = openai.beta.assistants.delete("assistant_id")

puts(assistant_deleted)

回應

{
  "id": "asst_abc123",
  "object": "assistant.deleted",
  "deleted": true
}
zh-tw
您的隱私權選擇
  • AI 免責聲明
  • 舊版本
  • 部落格
  • 參與
  • 隱私權
  • 消費者健康隱私
  • 使用規定
  • 商標
  • © Microsoft 2026