import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const thread = await client.threads.cancel('agent_abc123', 'thread_abc123');
console.log(thread.id);
import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
thread = client.threads.cancel(
agent_id="agent_abc123",
thread_id="thread_abc123",
)
print(thread.id)
Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.
POST
/
agents
/
{agentId}
/
threads
/
{threadId}
/
cancel
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const thread = await client.threads.cancel('agent_abc123', 'thread_abc123');
console.log(thread.id);
import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
thread = client.threads.cancel(
agent_id="agent_abc123",
thread_id="thread_abc123",
)
print(thread.id)
idle threads can accept a new turn or be closed. running threads have an active turn. awaiting threads are paused on external input such as approvals. closed threads are terminal.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cerca","description":"Build long-running agents on Cloudflare Workers with durable execution, custom tools, approvals, memory, and a cloud sandbox.","colors":{"primary":"#7C6340","light":"#E8E0D2","dark":"#7C6340"},"logo":{"light":"https://mintcdn.com/cerca/avU2YjV-ayl9ITnW/logo/light.svg?fit=max\u0026auto=format\u0026n=avU2YjV-ayl9ITnW\u0026q=85\u0026s=3a952f50a305b017db4af3b52443e78d","dark":"https://mintcdn.com/cerca/avU2YjV-ayl9ITnW/logo/dark.svg?fit=max\u0026auto=format\u0026n=avU2YjV-ayl9ITnW\u0026q=85\u0026s=f30eef939f273f15687674dc8671f91a","href":"https://docs.cerca.dev"},"favicon":"https://mintcdn.com/cerca/avU2YjV-ayl9ITnW/favicon.svg?fit=max\u0026auto=format\u0026n=avU2YjV-ayl9ITnW\u0026q=85\u0026s=5c0a8c9a4b99f21be8bf0fa07e2d420e","background":{"color":{"light":"#FFFDF8","dark":"#141008"}},"navbar":{"links":[{"href":"https://app.cerca.dev/sign-in","label":"Sign in"}],"primary":{"type":"button","label":"Get an API key","href":"https://app.cerca.dev/settings"}},"footer":{"socials":{"github":"https://github.com/matrices"}},"seo":{"indexing":"navigable"},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"list","href":"/changelog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cerca","hasAudioNarration":false,"actualSubdomain":"cerca","customDomains":["docs.cerca.dev"],"gitSource":{"type":"github","owner":"matrices","repo":"cell","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21ddd929c7042dd5f5fa13","collectionId":"ba226a70-e5d2-440b-8ce9-16ef02e5ae18","schemaVersion":"v2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a303907bbaa514ac1c6776e:failure","clientVersion":"0.0.3964","searchFilterCounts":[{"language":"default","tag":"API Reference","count":66},{"language":"default","tag":"Guides","count":17},{"language":"default","tag":"Threads","count":10},{"language":"default","tag":"Concepts","count":9},{"language":"default","tag":"Core concepts","count":9},{"language":"default","tag":"Agents","count":7},{"language":"default","tag":"Events","count":7},{"language":"default","tag":"Webhooks","count":7},{"language":"default","tag":"Approvals","count":6},{"language":"default","tag":"Connections","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/threads/cancel-thread","slug":"/api-reference/threads/cancel-thread","pageMetadata":{"title":"Cancel thread","description":"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/cancel","href":"/api-reference/threads/cancel-thread","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Cancel thread","description":"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/cancel","href":"/api-reference/threads/cancel-thread","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.","security":["2c78c5fe-5b00-4fee-b35f-86aefd1f6165"],"summary":"Cancel thread","tags":["Threads"],"parameters":["55140835-4c92-4589-a4f3-056f5f69df1c","0e4fc92c-8147-41c2-aeda-8015b4f49bb3"],"responses":{"200":"7b44d48e-cb83-46c2-8239-a53b426cc955","400":"fa9aeeab-c7e0-448d-9bd3-2e7eaa208fd6","401":"cdbad498-d495-4803-901b-c3baff75caad","403":"240fe6f4-68b3-40fd-a745-b8c2c8279924","404":"80be18c1-5585-4135-bdf3-7f58a5433ad6","409":"8e37c07a-044d-4f7f-8d08-140358851a81","429":"f8be8308-c395-48fe-bfe7-aedf945d5ef2","500":"39e44170-04e7-4a47-b59b-84ccbe36b222","503":"d750323a-a1ef-452f-90a0-54f9331a77e5","default":"4ea84764-fad5-44ae-8d3a-62d578897aac"},"x-codeSamples":[{"lang":"JavaScript","source":"import Cerca from '@cerca-dev/sdk';\n\nconst client = new Cerca({\n apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.threads.cancel('agent_abc123', 'thread_abc123');\n\nconsole.log(thread.id);"},{"lang":"Python","source":"import os\nfrom cerca import Cerca\n\nclient = Cerca(\n api_key=os.environ.get(\"CERCA_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.threads.cancel(\n agent_id=\"agent_abc123\",\n thread_id=\"thread_abc123\",\n)\nprint(thread.id)"},{"lang":"Go","source":"package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Threads.Cancel(\n\t\tcontext.TODO(),\n\t\t\"agent_abc123\",\n\t\t\"thread_abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", thread.ID)\n}\n"},{"lang":"Ruby","source":"require \"cerca\"\n\ncerca = Cerca::Client.new(api_key: \"My API Key\")\n\nthread = cerca.threads.cancel(\"agent_abc123\", \"thread_abc123\")\n\nputs(thread)"},{"lang":"CLI","source":"cerca threads cancel \\\n --api-key 'My API Key' \\\n --agent-id agent_abc123 \\\n --thread-id thread_abc123"}],"method":"post","type":"path","servers":["d2b2aefa-8204-4fa4-b0ac-351a68bfe8fe"],"path":"/agents/{agentId}/threads/{threadId}/cancel","baseUrlOptions":["https://api.cerca.dev"],"title":"Cancel thread","codeSamples":[{"lang":"JavaScript","source":"import Cerca from '@cerca-dev/sdk';\n\nconst client = new Cerca({\n apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.threads.cancel('agent_abc123', 'thread_abc123');\n\nconsole.log(thread.id);"},{"lang":"Python","source":"import os\nfrom cerca import Cerca\n\nclient = Cerca(\n api_key=os.environ.get(\"CERCA_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.threads.cancel(\n agent_id=\"agent_abc123\",\n thread_id=\"thread_abc123\",\n)\nprint(thread.id)"},{"lang":"Go","source":"package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Threads.Cancel(\n\t\tcontext.TODO(),\n\t\t\"agent_abc123\",\n\t\t\"thread_abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", thread.ID)\n}\n"},{"lang":"Ruby","source":"require \"cerca\"\n\ncerca = Cerca::Client.new(api_key: \"My API Key\")\n\nthread = cerca.threads.cancel(\"agent_abc123\", \"thread_abc123\")\n\nputs(thread)"},{"lang":"CLI","source":"cerca threads cancel \\\n --api-key 'My API Key' \\\n --agent-id agent_abc123 \\\n --thread-id thread_abc123"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"55140835-4c92-4589-a4f3-056f5f69df1c":{"schema":{"type":"string","minLength":1,"example":"agent_abc123","isRequired":true,"uniqueKey":"","typeLabel":"string"},"required":true,"in":"path","name":"agentId"},"0e4fc92c-8147-41c2-aeda-8015b4f49bb3":{"schema":{"type":"string","minLength":1,"example":"thread_abc123","isRequired":true,"uniqueKey":"","typeLabel":"string"},"required":true,"in":"path","name":"threadId"}},"responses":{"7b44d48e-cb83-46c2-8239-a53b426cc955":{"description":"Thread cancellation result.","content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","isRequired":true,"uniqueKey":"agentId","typeLabel":"string"},"completedAt":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"completedAt.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"completedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"completedAt","typeLabel":"string | null"},"createdAt":{"type":"string","isRequired":true,"uniqueKey":"createdAt","typeLabel":"string"},"depth":{"type":"number","isRequired":true,"uniqueKey":"depth","typeLabel":"number"},"error":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"error.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"error.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error","typeLabel":"string | null"},"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"instructions":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"instructions.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"instructions.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"instructions","typeLabel":"string | null"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"parentThreadId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"parentThreadId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"parentThreadId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"parentThreadId","typeLabel":"string | null"},"result":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"result.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"result.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"result","typeLabel":"string | null"},"scheduleId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"scheduleId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"scheduleId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"scheduleId","typeLabel":"string | null"},"scheduleSeq":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"scheduleSeq.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"scheduleSeq.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"scheduleSeq","typeLabel":"number | null"},"status":{"type":"string","enum":["idle","running","awaiting","closed"],"description":"`idle` threads can accept a new turn or be closed. `running` threads have an active turn. `awaiting` threads are paused on external input such as approvals. `closed` threads are terminal.","isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"updatedAt":{"type":"string","isRequired":true,"uniqueKey":"updatedAt","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"compiledContext":{"oneOf":[{"type":"object","properties":{"enabledTools":{"oneOf":[{"type":"array","items":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"],"uniqueKey":"compiledContext.oneOf.0.enabledTools.oneOf.0.items.[INDEX]","typeLabel":"enum\u003cstring>"},"isRequired":true,"uniqueKey":"compiledContext.oneOf.0.enabledTools.oneOf.0","typeLabel":"enum\u003cstring>[]"},{"type":"null","items":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"]},"isRequired":true,"uniqueKey":"compiledContext.oneOf.0.enabledTools.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compiledContext.oneOf.0.enabledTools","typeLabel":"enum\u003cstring>[] | null"},"systemPrompt":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"compiledContext.oneOf.0.systemPrompt.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"compiledContext.oneOf.0.systemPrompt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compiledContext.oneOf.0.systemPrompt","typeLabel":"string | null"},"turnId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"compiledContext.oneOf.0.turnId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"compiledContext.oneOf.0.turnId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compiledContext.oneOf.0.turnId","typeLabel":"string | null"}},"required":["enabledTools","systemPrompt","turnId"],"isRequired":true,"uniqueKey":"compiledContext.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"enabledTools":{"oneOf":[{"type":"array","items":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"]}},{"type":"null","items":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"]}}]},"systemPrompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"turnId":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["enabledTools","systemPrompt","turnId"],"isRequired":true,"uniqueKey":"compiledContext.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compiledContext","typeLabel":"object | null"},"compactionSummary":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"compactionSummary.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"compactionSummary.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compactionSummary","typeLabel":"string | null"},"compactionThroughSeq":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"compactionThroughSeq.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"compactionThroughSeq.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"compactionThroughSeq","typeLabel":"number | null"},"composedSystemPrompt":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"composedSystemPrompt.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"composedSystemPrompt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"composedSystemPrompt","typeLabel":"string | null"},"contextWindow":{"oneOf":[{"type":"object","properties":{"compacted":{"type":"boolean","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.compacted","typeLabel":"boolean"},"compactionThroughSeq":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.compactionThroughSeq.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.compactionThroughSeq.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"contextWindow.oneOf.0.compactionThroughSeq","typeLabel":"number | null"},"contextWindowTokens":{"type":"number","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.contextWindowTokens","typeLabel":"number"},"estimationMethod":{"type":"string","enum":["heuristic_request_v1"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"contextWindow.oneOf.0.estimationMethod","typeLabel":"enum\u003cstring>"},"llmEstimatedTokens":{"type":"number","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.llmEstimatedTokens","typeLabel":"number"},"model":{"type":"string","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.model","typeLabel":"string"},"rawEstimatedTokens":{"type":"number","isRequired":true,"uniqueKey":"contextWindow.oneOf.0.rawEstimatedTokens","typeLabel":"number"}},"required":["compacted","compactionThroughSeq","contextWindowTokens","estimationMethod","llmEstimatedTokens","model","rawEstimatedTokens"],"isRequired":true,"uniqueKey":"contextWindow.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"compacted":{"type":"boolean"},"compactionThroughSeq":{"oneOf":[{"type":"number"},{"type":"null"}]},"contextWindowTokens":{"type":"number"},"estimationMethod":{"type":"string","enum":["heuristic_request_v1"],"x-stainless-const":true},"llmEstimatedTokens":{"type":"number"},"model":{"type":"string"},"rawEstimatedTokens":{"type":"number"}},"required":["compacted","compactionThroughSeq","contextWindowTokens","estimationMethod","llmEstimatedTokens","model","rawEstimatedTokens"],"isRequired":true,"uniqueKey":"contextWindow.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"contextWindow","typeLabel":"object | null"},"hasMoreMessages":{"type":"boolean","isRequired":true,"uniqueKey":"hasMoreMessages","typeLabel":"boolean"},"lastTurnStatus":{"oneOf":[{"type":"string","enum":["completed","failed",null],"isRequired":true,"uniqueKey":"lastTurnStatus.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["completed","failed",null],"isRequired":true,"uniqueKey":"lastTurnStatus.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"lastTurnStatus","typeLabel":"enum\u003cstring> | null"},"messageCursor":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"messageCursor.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"messageCursor.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"messageCursor","typeLabel":"number | null"},"messages":{"type":"array","items":{"type":"object","properties":{"content":{"type":"array","items":{"oneOf":[{"type":"object","title":"TextContentBlock","description":"Message content block. The `type` field distinguishes text, tool use, tool result, server tool use, and web search result blocks.","required":["text","type"],"x-stainless-variantName":"TextContentBlock","example":{"text":"Hello","type":"text"},"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"providerMetadata":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0.providerMetadata.additionalProperties.additionalProperties","typeLabel":"string"},"description":"Provider-specific metadata for a message content block.","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0.providerMetadata.additionalProperties","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0.providerMetadata","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.0","typeLabel":"TextContentBlock · object"},{"type":"object","title":"ToolUseContentBlock","description":"Message content block. The `type` field distinguishes text, tool use, tool result, server tool use, and web search result blocks.","required":["id","input","name","type"],"x-stainless-variantName":"ToolUseContentBlock","example":{"type":"text"},"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.id","typeLabel":"string"},"input":{"description":"Any JSON value. Generated SDKs may expose this value boundary as unknown or Any.","x-stainless-any":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.input","typeLabel":"any"},"name":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.name","typeLabel":"enum\u003cstring>"},"type":{"type":"string","enum":["tool_use"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"providerMetadata":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.providerMetadata.additionalProperties.additionalProperties","typeLabel":"string"},"description":"Provider-specific metadata for a message content block.","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.providerMetadata.additionalProperties","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1.providerMetadata","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.1","typeLabel":"ToolUseContentBlock · object"},{"type":"object","title":"ToolResultContentBlock","description":"Message content block. The `type` field distinguishes text, tool use, tool result, server tool use, and web search result blocks.","required":["content","isError","toolUseId","type"],"x-stainless-variantName":"ToolResultContentBlock","example":{"type":"text"},"properties":{"content":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.content","typeLabel":"string"},"isError":{"type":"boolean","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.isError","typeLabel":"boolean"},"toolUseId":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.toolUseId","typeLabel":"string"},"type":{"type":"string","enum":["tool_result"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"deniedByUser":{"type":"boolean","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.deniedByUser","typeLabel":"boolean"},"providerMetadata":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.providerMetadata.additionalProperties.additionalProperties","typeLabel":"string"},"description":"Provider-specific metadata for a message content block.","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.providerMetadata.additionalProperties","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2.providerMetadata","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.2","typeLabel":"ToolResultContentBlock · object"},{"type":"object","title":"ServerToolUseContentBlock","description":"Message content block. The `type` field distinguishes text, tool use, tool result, server tool use, and web search result blocks.","required":["id","input","name","type"],"x-stainless-variantName":"ServerToolUseContentBlock","example":{"type":"text"},"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.id","typeLabel":"string"},"input":{"description":"Any JSON value. Generated SDKs may expose this value boundary as unknown or Any.","x-stainless-any":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.input","typeLabel":"any"},"name":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.name","typeLabel":"string"},"type":{"type":"string","enum":["server_tool_use"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"},"providerMetadata":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.providerMetadata.additionalProperties.additionalProperties","typeLabel":"string"},"description":"Provider-specific metadata for a message content block.","uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.providerMetadata.additionalProperties","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3.providerMetadata","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.3","typeLabel":"ServerToolUseContentBlock · object"},{"type":"object","title":"WebSearchToolResultContentBlock","description":"Message content block. The `type` field distinguishes text, tool use, tool result, server tool use, and web search result blocks.","required":["content","toolUseId","type"],"x-stainless-variantName":"WebSearchToolResultContentBlock","example":{"type":"text"},"properties":{"content":{"x-stainless-any":true,"description":"Web search result payload. The runtime returns either an array of web search results or an error object.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.4.content","typeLabel":"any"},"toolUseId":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.4.toolUseId","typeLabel":"string"},"type":{"type":"string","enum":["web_search_tool_result"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.4.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.items.[INDEX].oneOf.4","typeLabel":"WebSearchToolResultContentBlock · object"}],"uniqueKey":"messages.items.[INDEX].content.items.[INDEX]","typeLabel":"TextContentBlock · object | ToolUseContentBlock · object | ToolResultContentBlock · object | ServerToolUseContentBlock · object | WebSearchToolResultContentBlock · object"},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"(TextContentBlock · object | ToolUseContentBlock · object | ToolResultContentBlock · object | ServerToolUseContentBlock · object | WebSearchToolResultContentBlock · object)[]"},"createdAt":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].createdAt","typeLabel":"string"},"role":{"type":"string","enum":["user","assistant"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"seq":{"type":"number","isRequired":true,"uniqueKey":"messages.items.[INDEX].seq","typeLabel":"number"}},"required":["content","createdAt","role","seq"],"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"subThreads":{"type":"array","items":{"type":"object","properties":{"completedAt":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].completedAt.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].completedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].completedAt","typeLabel":"string | null"},"createdAt":{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].createdAt","typeLabel":"string"},"id":{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].id","typeLabel":"string"},"messageCount":{"type":"number","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].messageCount","typeLabel":"number"},"model":{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].model","typeLabel":"string"},"parentThreadId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].parentThreadId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].parentThreadId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].parentThreadId","typeLabel":"string | null"},"result":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].result.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].result.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].result","typeLabel":"string | null"},"scheduleId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleId","typeLabel":"string | null"},"scheduleSeq":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleSeq.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleSeq.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].scheduleSeq","typeLabel":"number | null"},"state":{"type":"string","enum":["pending","idle","running","awaiting","closed"],"description":"`pending` means the parent thread is still waiting on this sub-thread. Other values are the child thread lifecycle state.","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].state","typeLabel":"enum\u003cstring>"},"stepCount":{"type":"number","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].stepCount","typeLabel":"number"},"toolUseId":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].toolUseId.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"subThreads.items.[INDEX].toolUseId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"subThreads.items.[INDEX].toolUseId","typeLabel":"string | null"}},"required":["completedAt","createdAt","id","messageCount","model","parentThreadId","result","scheduleId","scheduleSeq","state","stepCount","toolUseId"],"uniqueKey":"subThreads.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"subThreads","typeLabel":"object[]"},"tools":{"type":"array","items":{"type":"string","enum":["get_time","sub_thread","wait","tool.call","tool.discover","artifact.read","agent.threads.list","agent.threads.get","agent.approvals.cancel","agent.approvals.grant_thread","agent.approvals.grant_agent","agent.create","agent.approvals.update","tool.connect","sandbox.exec","sandbox.read","sandbox.write_file","sandbox.read_file","sandbox.spawn","sandbox.stdin","sandbox.session_read","sandbox.kill","sandbox.list_sessions","sandbox.sync_artifact","memory.read","memory.list","memory.search","memory.write","memory.delete","db.query","web.search","web.fetch","agent.schedule.list","agent.schedule.create","agent.schedule.update","agent.schedule.delete","agent.schedule.trigger"],"uniqueKey":"tools.items.[INDEX]","typeLabel":"enum\u003cstring>"},"isRequired":true,"uniqueKey":"tools","typeLabel":"enum\u003cstring>[]"},"turns":{"type":"array","items":{"type":"object","properties":{"completedAt":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].completedAt.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"turns.items.[INDEX].completedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"turns.items.[INDEX].completedAt","typeLabel":"string | null"},"endMessageSeq":{"oneOf":[{"type":"number","isRequired":true,"uniqueKey":"turns.items.[INDEX].endMessageSeq.oneOf.0","typeLabel":"number"},{"type":"null","isRequired":true,"uniqueKey":"turns.items.[INDEX].endMessageSeq.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"turns.items.[INDEX].endMessageSeq","typeLabel":"number | null"},"error":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].error.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"turns.items.[INDEX].error.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"turns.items.[INDEX].error","typeLabel":"string | null"},"id":{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].id","typeLabel":"string"},"result":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].result.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"turns.items.[INDEX].result.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"turns.items.[INDEX].result","typeLabel":"string | null"},"seq":{"type":"number","isRequired":true,"uniqueKey":"turns.items.[INDEX].seq","typeLabel":"number"},"startMessageSeq":{"type":"number","isRequired":true,"uniqueKey":"turns.items.[INDEX].startMessageSeq","typeLabel":"number"},"startedAt":{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].startedAt","typeLabel":"string"},"status":{"type":"string","enum":["running","completed","failed"],"isRequired":true,"uniqueKey":"turns.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"threadId":{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].threadId","typeLabel":"string"},"tokenUsage":{"oneOf":[{"type":"object","properties":{"inputTokens":{"type":"number","isRequired":true,"uniqueKey":"turns.items.[INDEX].tokenUsage.oneOf.0.inputTokens","typeLabel":"number"},"outputTokens":{"type":"number","isRequired":true,"uniqueKey":"turns.items.[INDEX].tokenUsage.oneOf.0.outputTokens","typeLabel":"number"}},"required":["inputTokens","outputTokens"],"isRequired":true,"uniqueKey":"turns.items.[INDEX].tokenUsage.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"inputTokens":{"type":"number"},"outputTokens":{"type":"number"}},"required":["inputTokens","outputTokens"],"isRequired":true,"uniqueKey":"turns.items.[INDEX].tokenUsage.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"turns.items.[INDEX].tokenUsage","typeLabel":"object | null"},"message":{"type":"string","isRequired":true,"uniqueKey":"turns.items.[INDEX].message","typeLabel":"string"}},"required":["completedAt","endMessageSeq","error","id","result","seq","startMessageSeq","startedAt","status","threadId","tokenUsage","message"],"uniqueKey":"turns.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"turns","typeLabel":"object[]"},"externalToolNamespaces":{"oneOf":[{"type":"string","enum":["all"],"x-stainless-const":true,"uniqueKey":"externalToolNamespaces.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"array","items":{"type":"string","uniqueKey":"externalToolNamespaces.oneOf.1.items.[INDEX]","typeLabel":"string"},"uniqueKey":"externalToolNamespaces.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"externalToolNamespaces","typeLabel":"enum\u003cstring> | string[]"},"activeTurnModel":{"oneOf":[{"type":"string","uniqueKey":"activeTurnModel.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"activeTurnModel.oneOf.1","typeLabel":"null"}],"uniqueKey":"activeTurnModel","typeLabel":"string | null"}},"required":["agentId","completedAt","createdAt","depth","error","id","instructions","model","parentThreadId","result","scheduleId","scheduleSeq","status","updatedAt","message","compiledContext","compactionSummary","compactionThroughSeq","composedSystemPrompt","contextWindow","hasMoreMessages","lastTurnStatus","messageCursor","messages","subThreads","tools","turns"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"agentId":"\u003cstring>","completedAt":"\u003cstring>","createdAt":"\u003cstring>","depth":123,"error":"\u003cstring>","id":"\u003cstring>","instructions":"\u003cstring>","model":"\u003cstring>","parentThreadId":"\u003cstring>","result":"\u003cstring>","scheduleId":"\u003cstring>","scheduleSeq":123,"status":"idle","updatedAt":"\u003cstring>","message":"\u003cstring>","compiledContext":{"enabledTools":["get_time"],"systemPrompt":"\u003cstring>","turnId":"\u003cstring>"},"compactionSummary":"\u003cstring>","compactionThroughSeq":123,"composedSystemPrompt":"\u003cstring>","contextWindow":{"compacted":true,"compactionThroughSeq":123,"contextWindowTokens":123,"estimationMethod":"heuristic_request_v1","llmEstimatedTokens":123,"model":"\u003cstring>","rawEstimatedTokens":123},"hasMoreMessages":true,"lastTurnStatus":"completed","messageCursor":123,"messages":[{"content":[{"text":"Hello","type":"text"}],"createdAt":"\u003cstring>","role":"user","seq":123}],"subThreads":[{"completedAt":"\u003cstring>","createdAt":"\u003cstring>","id":"\u003cstring>","messageCount":123,"model":"\u003cstring>","parentThreadId":"\u003cstring>","result":"\u003cstring>","scheduleId":"\u003cstring>","scheduleSeq":123,"state":"pending","stepCount":123,"toolUseId":"\u003cstring>"}],"tools":["get_time"],"turns":[{"completedAt":"\u003cstring>","endMessageSeq":123,"error":"\u003cstring>","id":"\u003cstring>","result":"\u003cstring>","seq":123,"startMessageSeq":123,"startedAt":"\u003cstring>","status":"running","threadId":"\u003cstring>","tokenUsage":{"inputTokens":123,"outputTokens":123},"message":"\u003cstring>"}],"externalToolNamespaces":"all","activeTurnModel":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"fa9aeeab-c7e0-448d-9bd3-2e7eaa208fd6":{"description":"Invalid runtime request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"cdbad498-d495-4803-901b-c3baff75caad":{"description":"Authentication required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"240fe6f4-68b3-40fd-a745-b8c2c8279924":{"description":"Access denied or non-transient quota exceeded. Limit errors include a stable code field.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"80be18c1-5585-4135-bdf3-7f58a5433ad6":{"description":"Runtime resource not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"8e37c07a-044d-4f7f-8d08-140358851a81":{"description":"Thread lifecycle conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"f8be8308-c395-48fe-bfe7-aedf945d5ef2":{"description":"Transient capacity limit exceeded. Limit errors include a stable code field.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"39e44170-04e7-4a47-b59b-84ccbe36b222":{"description":"Thread lifecycle operation failed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"d750323a-a1ef-452f-90a0-54f9331a77e5":{"description":"Required runtime dependency unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"},"4ea84764-fad5-44ae-8d3a-62d578897aac":{"description":"Runtime error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Stable machine-readable error code when the API can provide one.","example":"MONTHLY_TOKEN_BUDGET_EXCEEDED","uniqueKey":"code","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"MONTHLY_TOKEN_BUDGET_EXCEEDED"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"2c78c5fe-5b00-4fee-b35f-86aefd1f6165":{"bearerAuth":{"bearerFormat":"Cerca API key","scheme":"bearer","type":"http","scopes":[]}}},"servers":{"d2b2aefa-8204-4fa4-b0ac-351a68bfe8fe":{"url":"https://api.cerca.dev"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"bearerFormat":"Cerca API key","scheme":"bearer","type":"http","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml"},"subdomain":"cerca","siteName":"Cerca","title":"Cancel thread - Cerca","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-06T20:30:15.083Z","originalFileLocation":"api-reference/threads/cancel-thread.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cerca\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel thread - Cerca\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cerca\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cerca.dev/api-reference/threads/cancel-thread\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cerca.mintlify.app/_mintlify/api/og/v2?division=Threads\u0026amp;title=Cancel+thread\u0026amp;description=Cancel+a+running+or+awaiting+thread.+The+underlying+runtime+treats+repeat+cancellation+as+an+idempotent+lifecycle+operation+when+possible.\u0026amp;theme=fc49af25e83b722074099bcb\u0026amp;signature=c1637d98994ea105b96832cf155e5f5f5d3c408072ced8b1727665c190b45e6a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Cancel thread - Cerca\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cerca.mintlify.app/_mintlify/api/og/v2?division=Threads\u0026amp;title=Cancel+thread\u0026amp;description=Cancel+a+running+or+awaiting+thread.+The+underlying+runtime+treats+repeat+cancellation+as+an+idempotent+lifecycle+operation+when+possible.\u0026amp;theme=fc49af25e83b722074099bcb\u0026amp;signature=c1637d98994ea105b96832cf155e5f5f5d3c408072ced8b1727665c190b45e6a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cerca/U1XT9hQUrE53iVjp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cerca\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7C6340\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cerca.dev/api-reference/threads/cancel-thread\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/threads/cancel-thread.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cerca.dev/#organization\",\"name\":\"Cerca\",\"url\":\"https://docs.cerca.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cerca/avU2YjV-ayl9ITnW/logo/light.svg?fit=max\u0026auto=format\u0026n=avU2YjV-ayl9ITnW\u0026q=85\u0026s=3a952f50a305b017db4af3b52443e78d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cerca.dev#website\",\"name\":\"Cerca\",\"url\":\"https://docs.cerca.dev\",\"publisher\":{\"@id\":\"https://docs.cerca.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread#webpage\",\"url\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread\",\"name\":\"Cancel thread\",\"description\":\"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\",\"dateModified\":\"2026-05-06T20:30:15.083Z\",\"isPartOf\":{\"@id\":\"https://docs.cerca.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Threads\",\"item\":\"https://docs.cerca.dev/api-reference/threads/list-threads\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cancel thread\",\"item\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread#apireference\",\"headline\":\"Cancel thread\",\"name\":\"Cancel thread\",\"description\":\"Cancel a running or awaiting thread. The underlying runtime treats repeat cancellation as an idempotent lifecycle operation when possible.\",\"url\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cerca.dev/api-reference/threads/cancel-thread#webpage\"},\"dateModified\":\"2026-05-06T20:30:15.083Z\",\"publisher\":{\"@id\":\"https://docs.cerca.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cerca.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cerca\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Cerca","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"list","href":"/changelog"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"API Reference","icon":"square-terminal","groups":[{"group":"Auth","pages":[{"title":"Retrieve context","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /auth/context","href":"/api-reference/auth/retrieve-context"},{"title":"List fleets","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /auth/fleets","href":"/api-reference/auth/list-fleets"}]},{"group":"OAuth","pages":[{"title":"Start OAuth authorization","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /oauth/connect/{provider}","href":"/api-reference/oauth/start-oauth-authorization"}]},{"group":"Connections","pages":[{"title":"Create API key","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /connections/api-keys","href":"/api-reference/connections/create-api-key"},{"title":"List connections","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /connections","href":"/api-reference/connections/list-connections"},{"title":"Delete connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /connections/{connectionId}","href":"/api-reference/connections/delete-connection"},{"title":"List connections","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/connections","href":"/api-reference/connections/list-connections-1"},{"title":"Attach connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/connections","href":"/api-reference/connections/attach-connection"},{"title":"Detach connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}/connections/{connectionId}","href":"/api-reference/connections/detach-connection"}]},{"group":"Tools","pages":[{"title":"List tools","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/tools","href":"/api-reference/tools/list-tools"},{"title":"Create tool","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /fleets/{fleetId}/tools","href":"/api-reference/tools/create-tool"},{"title":"Retrieve tool source","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/tools/{sourceId}","href":"/api-reference/tools/retrieve-tool-source"},{"title":"Update tool source","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /fleets/{fleetId}/tools/{sourceId}","href":"/api-reference/tools/update-tool-source"},{"title":"Delete tool source","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /fleets/{fleetId}/tools/{sourceId}","href":"/api-reference/tools/delete-tool-source"},{"title":"List tools","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/tools","href":"/api-reference/tools/list-tools-1"}]},{"group":"Webhooks","pages":[{"title":"List webhooks","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/webhooks","href":"/api-reference/webhooks/list-webhooks"},{"title":"Create webhook","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /fleets/{fleetId}/webhooks","href":"/api-reference/webhooks/create-webhook"},{"title":"Retrieve webhook","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/webhooks/{webhookId}","href":"/api-reference/webhooks/retrieve-webhook"},{"title":"Update webhook","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /fleets/{fleetId}/webhooks/{webhookId}","href":"/api-reference/webhooks/update-webhook"},{"title":"Delete webhook","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /fleets/{fleetId}/webhooks/{webhookId}","href":"/api-reference/webhooks/delete-webhook"},{"title":"Rotate webhook secret","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /fleets/{fleetId}/webhooks/{webhookId}/rotate","href":"/api-reference/webhooks/rotate-webhook-secret"},{"title":"Send test webhook","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /fleets/{fleetId}/webhooks/{webhookId}/test","href":"/api-reference/webhooks/send-test-webhook"}]},{"group":"Agents","pages":[{"title":"List agents","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents","href":"/api-reference/agents/list-agents"},{"title":"Create agent","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents","href":"/api-reference/agents/create-agent"},{"title":"Retrieve agent","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}","href":"/api-reference/agents/retrieve-agent"},{"title":"Update agent","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /agents/{agentId}","href":"/api-reference/agents/update-agent"},{"title":"Delete agent","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}","href":"/api-reference/agents/delete-agent"},{"title":"Retrieve config","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/config","href":"/api-reference/agents/retrieve-config"},{"title":"Update metadata","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml patch /agents/{agentId}/metadata","href":"/api-reference/agents/update-metadata"}]},{"group":"Context","pages":[{"title":"List context entries","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/context","href":"/api-reference/context/list-context-entries"},{"title":"Retrieve context entry","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/context/entry","href":"/api-reference/context/retrieve-context-entry"},{"title":"Update context entry","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /agents/{agentId}/context/entry","href":"/api-reference/context/update-context-entry"},{"title":"Delete context entry","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}/context/entry","href":"/api-reference/context/delete-context-entry"},{"title":"Search context","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/context/search","href":"/api-reference/context/search-context"}]},{"group":"Schedules","pages":[{"title":"List schedules","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/schedules","href":"/api-reference/schedules/list-schedules"},{"title":"Create schedule","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/schedules","href":"/api-reference/schedules/create-schedule"},{"title":"Update schedule","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /agents/{agentId}/schedules/{scheduleId}","href":"/api-reference/schedules/update-schedule"},{"title":"Delete schedule","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}/schedules/{scheduleId}","href":"/api-reference/schedules/delete-schedule"},{"title":"Trigger schedule","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/schedules/{scheduleId}/trigger","href":"/api-reference/schedules/trigger-schedule"}]},{"group":"Threads","pages":[{"title":"List threads","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads","href":"/api-reference/threads/list-threads"},{"title":"Create thread","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads","href":"/api-reference/threads/create-thread"},{"title":"Retrieve thread","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}","href":"/api-reference/threads/retrieve-thread"},{"title":"List thread messages","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/messages","href":"/api-reference/threads/list-thread-messages"},{"title":"Get thread activity","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/activity","href":"/api-reference/threads/get-thread-activity"},{"title":"Create turn","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/turns","href":"/api-reference/threads/create-turn"},{"title":"Steer thread","description":"Steer a thread with another user message. Steering a closed thread returns a conflict; steering a running or awaiting thread queues the message.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/steer","href":"/api-reference/threads/steer-thread"},{"title":"Cancel thread","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/cancel","href":"/api-reference/threads/cancel-thread"},{"title":"Close thread","description":"Close an idle thread. Closing a running, awaiting, or already-closed thread returns a lifecycle conflict.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/close","href":"/api-reference/threads/close-thread"},{"title":"Compact thread","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/compact","href":"/api-reference/threads/compact-thread"}]},{"group":"Approvals","pages":[{"title":"List approvals","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/approvals","href":"/api-reference/approvals/list-approvals"},{"title":"List approval grants","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/approval-grants","href":"/api-reference/approvals/list-approval-grants"},{"title":"Delete approval grant","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}/approval-grants/{grantId}","href":"/api-reference/approvals/delete-approval-grant"},{"title":"List approval grants","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/approval-grants","href":"/api-reference/approvals/list-approval-grants-1"},{"title":"Delete approval grant","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml delete /agents/{agentId}/threads/{threadId}/approval-grants/{grantId}","href":"/api-reference/approvals/delete-approval-grant-1"},{"title":"Create approval","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/threads/{threadId}/approvals/{approvalId}","href":"/api-reference/approvals/create-approval"}]},{"group":"Sandbox","pages":[{"title":"Execute sandbox command","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/sandbox/exec","href":"/api-reference/sandbox/execute-sandbox-command"},{"title":"Write sandbox file","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/sandbox/write","href":"/api-reference/sandbox/write-sandbox-file"},{"title":"Read sandbox file","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /agents/{agentId}/sandbox/read","href":"/api-reference/sandbox/read-sandbox-file"}]},{"group":"Events","pages":[{"title":"List events","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/events","href":"/api-reference/events/list-events"},{"title":"List events","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/events","href":"/api-reference/events/list-events-1"},{"title":"List events","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/events","href":"/api-reference/events/list-events-2"},{"title":"Fleet event stream","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/events/stream","href":"/api-reference/events/fleet-event-stream"},{"title":"Agent event stream","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/events/stream","href":"/api-reference/events/agent-event-stream"},{"title":"Thread event stream","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/events/stream","href":"/api-reference/events/thread-event-stream"},{"title":"Thread message stream","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/stream","href":"/api-reference/events/thread-message-stream"}]},{"group":"Models","pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /models","href":"/api-reference/models/list-models"}]}]}]},"title":"Cancel thread - Cerca","buildId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","deploymentId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BRm_l__d.js","utils-f1l1Oc-G.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BlhqDhJO.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DHCB7rsC.js","snippetPresets-CYXLx6Hv.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-B78P2dEq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C4YLPVAh.js","shallow-vlLnTDkQ.js","getApiPlaygroundDisplay-D_98hhvf.js","CodeSnippet-DtnZHGqq.js","CodeSnippets-CLFb8KJt.js","Page-kQh739Uz.js","getPastedJson-Cq-zlbnU.js","icon-sN3t983t.js","MethodPill-P_YQ2s09.js","DuplicateIcon-BVzyNsGJ.js","createIcon-B3jqgqC6.js","DynamicMarkdown-Crwq6WG_.js","SectionHeading-C7pGS2Bb.js","axios-vUo_bRtp.js","Markdown-BuPH8yuW.js","clsx-CCOYKgaU.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BnkC_6oA.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BM4S31-f.js"]}