Delete an assistant
Delete an AI Assistant by assistant_id.
DELETE
/
ai
/
assistants
/
{assistant_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistant = await client.ai.assistants.delete('assistant_id');
console.log(assistant.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
assistant = client.ai.assistants.delete(
"assistant_id",
)
print(assistant.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
assistant, err := client.AI.Assistants.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteParams;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantDeleteResponse assistant = client.ai().assistants().delete("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant = telnyx.ai.assistants.delete("assistant_id")
puts(assistant)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistant = $client->ai->assistants->delete('assistant_id');
var_dump($assistant);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants delete \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request DELETE \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "<string>",
"deleted": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the assistant.
Response
Successful Response
Aligns with the OpenAI API: https://platform.openai.com/docs/api-reference/assistants/deleteAssistant
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistant = await client.ai.assistants.delete('assistant_id');
console.log(assistant.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
assistant = client.ai.assistants.delete(
"assistant_id",
)
print(assistant.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
assistant, err := client.AI.Assistants.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteParams;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantDeleteResponse assistant = client.ai().assistants().delete("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant = telnyx.ai.assistants.delete("assistant_id")
puts(assistant)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistant = $client->ai->assistants->delete('assistant_id');
var_dump($assistant);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants delete \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request DELETE \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "<string>",
"deleted": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}