Ana içeriğe atla

Bu tarayıcı artık desteklenmiyor.

En son özelliklerden, güvenlik güncelleştirmelerinden ve teknik destekten faydalanmak için Microsoft Edge’e yükseltin.

Microsoft Edge'i indirin Internet Explorer ve Microsoft Edge hakkında daha fazla bilgi
microsoft-foundry.rest.security.o-auth2-auth

Conversations

Delete a conversation item

DELETE /openai/v1/conversations/{conversation_id}/items/{item_id}

Removes the specified item from a conversation.

Yol parametreleri

conversation_id string gerekli

The id of the conversation on which the item needs to be deleted from.

item_id string gerekli

The id of the conversation item to delete.

Üst bilgi parametreleri

x-ms-user-identity string

Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the agents/endpoints/UserIdentityImpersonation/action RBAC permission.

Yanıtlar

The request has succeeded.

Gövde

Content-Type: application/json
id string gerekli

The unique ID of the conversation.

object enum gerekli

The object type, which is always conversation.

conversation
metadata OpenAI.Metadata gerekli

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

[key: string] string
created_at integer gerekli

The time at which the conversation was created, measured in seconds since the Unix epoch.

Client error

Gövde

Content-Type: application/json
error OpenAI.Error gerekli
code string | null gerekli
message string gerekli
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Aşağıdakilerden biri:
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 gerekli

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Gövde

Content-Type: application/json
error OpenAI.Error gerekli
code string | null gerekli
message string gerekli
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Aşağıdakilerden biri:
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 gerekli

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

İstek

curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
  -H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from "openai";
const client = new OpenAI();

const conversation = await client.conversations.items.delete(
  "conv_123",
  "msg_abc"
);
console.log(conversation);
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
conversation = client.conversations.items.delete(
    item_id="msg_abc",
    conversation_id="conv_123",
)
print(conversation.id)
using System;
using OpenAI.Conversations;

OpenAIConversationClient client = new(
    apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
);

Conversation conversation = client.ConversationItems.Delete(
    conversationId: "conv_123",
    itemId: "msg_abc"
);
Console.WriteLine(conversation.Id);
import OpenAI from 'openai';

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

const conversation = await client.conversations.items.delete('msg_abc', {
  conversation_id: 'conv_123',
});

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

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.conversations.Conversation;
import com.openai.models.conversations.items.ItemDeleteParams;

public final class Main {
    private Main() {}

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

        ItemDeleteParams params = ItemDeleteParams.builder()
            .conversationId("conv_123")
            .itemId("msg_abc")
            .build();
        Conversation conversation = client.conversations().items().delete(params);
    }
}
require "openai"

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

conversation = openai.conversations.items.delete("msg_abc", conversation_id: "conv_123")

puts(conversation)

Response

{
  "id": "conv_123",
  "object": "conversation",
  "created_at": 1741900000,
  "metadata": {"topic": "demo"}
}
tr-tr
Gizlilik Tercihleriniz
  • AI Bildirim
  • Önceki Sürümler
  • Blog
  • Katkıda Bulunun
  • Gizlilik
  • Tüketici Sağlığı Gizliliği
  • Kullanım Koşulları
  • Ticari Markalar
  • © Microsoft 2026