JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const task = await client.tasks.delete('task_677efb5139a88190b512bc3fef8e535d');
console.log(task.id);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
task = client.tasks.delete(
"task_677efb5139a88190b512bc3fef8e535d",
)
print(task.id)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
task, err := client.Tasks.Delete(context.TODO(), "task_677efb5139a88190b512bc3fef8e535d")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.ID)
}
curl --request DELETE \
--url https://api.linxueyuan.online/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.linxueyuan.online/v1/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"content": [
{
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
]
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"code": 123,
"message": "<string>",
"data": {}
}Tasks
Delete an agent task
Deletes a model task with the given ID.
DELETE
/
tasks
/
{task_id}
JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const task = await client.tasks.delete('task_677efb5139a88190b512bc3fef8e535d');
console.log(task.id);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
task = client.tasks.delete(
"task_677efb5139a88190b512bc3fef8e535d",
)
print(task.id)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
task, err := client.Tasks.Delete(context.TODO(), "task_677efb5139a88190b512bc3fef8e535d")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.ID)
}
curl --request DELETE \
--url https://api.linxueyuan.online/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.linxueyuan.online/v1/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": "<string>",
"result": {
"object": "task",
"id": "<string>",
"session_id": "<string>",
"user_id": "<string>",
"created_at": 123,
"output": [
{
"type": "reasoning",
"id": "<string>",
"summary": [
{
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
],
"content": [
{
"text": "<string>",
"id": 123,
"tags": [
"<string>"
],
"annotations": [
{
"type": "file_citation",
"file_id": "<string>",
"index": 123,
"filename": "<string>"
}
],
"logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
]
}
],
"usage": {},
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"input_required": {
"type": "tool_call",
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>",
"id": "<string>"
},
"metadata": {},
"previous_task_id": "<string>",
"rollouts": [
{}
]
},
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"code": 123,
"message": "<string>",
"data": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the task to delete.
Example:
"task_677efb5139a88190b512bc3fef8e535d"
Was this page helpful?
⌘I