Cancel Task Run
curl --request POST \
--url https://api.talqing.com/v1/task-runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/task-runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/task-runs/{run_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.talqing.com/v1/task-runs/{run_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/task-runs/{run_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/task-runs/{run_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/task-runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"attempts": 0,
"background": false,
"billing_status": "pending",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"config": {
"name": "<string>",
"faqs": [
{
"faq": {
"entries": [
{
"answer": "<string>",
"question": "<string>"
}
],
"name": "<string>"
},
"faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"finish_without_result_description": "Finish without result only if you have failed to achieve the goal of this task and would like to give up rather than continue.",
"llm": {
"builtin_tools": [
{
"type": "<string>",
"config": {}
}
],
"fallback": {
"builtin_tools": [
{
"type": "<string>",
"config": {}
}
],
"hosts": [
"<string>"
],
"model": "gpt-5.6-luna",
"priority": false,
"provider": "openai",
"reasoning_effort": "none"
},
"hosts": [
"<string>"
],
"model": "gpt-5.6-luna",
"priority": false,
"provider": "openai",
"reasoning_effort": "none"
},
"max_steps": 25,
"mcps": [
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mcp": {
"name": "<string>",
"url": "<string>",
"allowed_tools": [
"<string>"
],
"headers": {},
"tools_namespace": ""
}
}
],
"on_enter": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"on_exit": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"on_user_turn_completed": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"output": [
{
"description": "<string>",
"name": "<string>",
"enum": [
"<string>"
],
"fields": [
"<unknown>"
],
"items": {
"description": "",
"enum": [
"<string>"
],
"fields": [
"<unknown>"
],
"items": "<unknown>",
"type": "string"
},
"required": true,
"type": "string"
}
],
"prompt": "",
"submit_result_description": "Submit results if you are sure that you have achieved the goal of this task",
"timeout_seconds": 300,
"timezone": "<string>",
"tools": [
{
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
}
],
"vars": [
{
"name": "<string>",
"default": "<string>",
"description": "",
"required": false,
"type": "text",
"untrusted": false
}
]
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"content_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"ended_at": "2023-11-07T05:31:56Z",
"error": {
"message": "<string>",
"type": "invalid_input"
},
"files": [
{
"bytes": 123,
"filename": "<string>",
"images": [
{
"height": 123,
"page": 123,
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"width": 123
}
],
"input": "<string>",
"pages": 123,
"text": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"max_steps": 0,
"metadata": {},
"output": {},
"provider_cost": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "queued",
"steps_used": 0,
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"task_version": 123,
"trace": [
{
"kind": "message",
"name": "<string>",
"step": 123,
"args": "<unknown>",
"ms": 123,
"result": "<unknown>",
"truncated": false
}
],
"tries": 0,
"usage": [
{
"input_cache_write_tokens": 0,
"input_cached_tokens": 0,
"input_tokens": 0,
"model": "<string>",
"output_tokens": 0,
"priority": false,
"provider": "<string>",
"purpose": "conversation",
"reported_cost": 123
}
],
"vars": {}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}tasks
Cancel Task Run
Cancel a queued or background run. A running one stops within seconds.
POST
/
v1
/
task-runs
/
{run_id}
/
cancel
Cancel Task Run
curl --request POST \
--url https://api.talqing.com/v1/task-runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/task-runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/task-runs/{run_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.talqing.com/v1/task-runs/{run_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/task-runs/{run_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/task-runs/{run_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/task-runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"attempts": 0,
"background": false,
"billing_status": "pending",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"config": {
"name": "<string>",
"faqs": [
{
"faq": {
"entries": [
{
"answer": "<string>",
"question": "<string>"
}
],
"name": "<string>"
},
"faq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"finish_without_result_description": "Finish without result only if you have failed to achieve the goal of this task and would like to give up rather than continue.",
"llm": {
"builtin_tools": [
{
"type": "<string>",
"config": {}
}
],
"fallback": {
"builtin_tools": [
{
"type": "<string>",
"config": {}
}
],
"hosts": [
"<string>"
],
"model": "gpt-5.6-luna",
"priority": false,
"provider": "openai",
"reasoning_effort": "none"
},
"hosts": [
"<string>"
],
"model": "gpt-5.6-luna",
"priority": false,
"provider": "openai",
"reasoning_effort": "none"
},
"max_steps": 25,
"mcps": [
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mcp": {
"name": "<string>",
"url": "<string>",
"allowed_tools": [
"<string>"
],
"headers": {},
"tools_namespace": ""
}
}
],
"on_enter": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"on_exit": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"on_user_turn_completed": {
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
},
"output": [
{
"description": "<string>",
"name": "<string>",
"enum": [
"<string>"
],
"fields": [
"<unknown>"
],
"items": {
"description": "",
"enum": [
"<string>"
],
"fields": [
"<unknown>"
],
"items": "<unknown>",
"type": "string"
},
"required": true,
"type": "string"
}
],
"prompt": "",
"submit_result_description": "Submit results if you are sure that you have achieved the goal of this task",
"timeout_seconds": 300,
"timezone": "<string>",
"tools": [
{
"tool": {
"name": "<string>",
"description": "",
"disable_interruptions": false,
"json_schema": {},
"long_running_task": false,
"operations": [
{
"config": {
"method": "GET",
"url": "<string>",
"body": "<unknown>",
"headers": {},
"query": {},
"timeout": 60
},
"kind": "http",
"background_execution": false,
"on_error": "abort",
"publish_fields": [
{
"path": "<string>",
"store": "tooldata",
"key": "<string>"
}
],
"silent": false
}
],
"silent": false
},
"tool_id": "<string>",
"tool_version": 123
}
],
"vars": [
{
"name": "<string>",
"default": "<string>",
"description": "",
"required": false,
"type": "text",
"untrusted": false
}
]
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"content_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"ended_at": "2023-11-07T05:31:56Z",
"error": {
"message": "<string>",
"type": "invalid_input"
},
"files": [
{
"bytes": 123,
"filename": "<string>",
"images": [
{
"height": 123,
"page": 123,
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"width": 123
}
],
"input": "<string>",
"pages": 123,
"text": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"max_steps": 0,
"metadata": {},
"output": {},
"provider_cost": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "queued",
"steps_used": 0,
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"task_version": 123,
"trace": [
{
"kind": "message",
"name": "<string>",
"step": 123,
"args": "<unknown>",
"ms": 123,
"result": "<unknown>",
"truncated": false
}
],
"tries": 0,
"usage": [
{
"input_cache_write_tokens": 0,
"input_cached_tokens": 0,
"input_tokens": 0,
"model": "<string>",
"output_tokens": 0,
"priority": false,
"provider": "<string>",
"purpose": "conversation",
"reported_cost": 123
}
],
"vars": {}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
BearerAuthSessionCookie
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
One run in full: the config it ran, its inputs, its trace and its usage.
LiveKit's AgentTask: an agent with a typed result, on someone else's stack.
It declares no channel, no media and no greeting. Entered by an agent it
speaks with that call's voice and hears with its ears; run on its own from
POST /task-runs it is an LLM with tools and nobody to talk to. Which
of the two happens is the caller's, never the task's.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
queued, running, completed, failed, canceled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes