Tako agent API
The agent API from Tako — 4 operation(s) for agent.
The agent API from Tako — 4 operation(s) for agent.
openapi: 3.1.0
info:
title: Knowledge Search agent API
version: 1.0.0
servers:
- url: https://tako.com/api/
description: Tako Production API Server
tags:
- name: agent
paths:
/v1/agent/answer/runs:
get:
tags:
- agent
summary: List answer agent runs
description: List the authenticated caller's answer agent runs, newest first. Returns trimmed run summaries. Fetch full detail via GET /v1/agent/answer/runs/{run_id}.
operationId: listAnswerAgentRuns
parameters:
- description: Opaque pagination cursor from a previous response's next_cursor.
required: false
schema:
type: string
name: cursor
in: query
- description: Max runs to return (default 20, max 100).
required: false
schema:
type: integer
maximum: 100.0
minimum: 1.0
name: limit
in: query
responses:
'200':
description: A page of the caller's answer agent runs, newest first.
content:
application/json:
schema:
$ref: '#/components/schemas/AnswerAgentRunList'
'400':
description: Invalid pagination parameter (limit or cursor).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
post:
tags:
- agent
summary: Dispatch an answer agent run
description: Dispatch an answer agent run. Returns 202 with an AnswerAgentRun object. Poll GET /v1/agent/answer/runs/{run_id} until status is 'completed' or 'failed'.
operationId: createAnswerAgentRun
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AnswerAgentRunRequest'
responses:
'202':
description: 'Run dispatched. With Accept: application/json, poll GET /v1/agent/answer/runs/{run_id} for the run status. With Accept: text/event-stream, the response is an SSE stream of AnswerAgentStreamEnvelope events. The stream ends at stream_done. If the stream ends without an agent_result event, poll GET /v1/agent/answer/runs/{run_id} for the terminal status.'
content:
application/json:
schema:
$ref: '#/components/schemas/AnswerAgentRun'
text/event-stream:
schema:
$ref: '#/components/schemas/AnswerAgentStreamEnvelope'
'400':
description: Invalid request (for example, a blank query or a malformed body).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'402':
description: Insufficient API credit balance (PAYG pre-dispatch gate).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'404':
description: thread_id does not exist or is not owned by the caller.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'409':
description: 'Conflict. code is one of: ''conflict'' (the thread already has a run in flight); ''thread_product_mismatch'' (the thread belongs to a different agent product); ''source_indexes_mismatch'' (a follow-up changed the thread''s pinned source_indexes).'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'500':
description: Failed to dispatch the agent run.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
/v1/agent/answer/runs/{run_id}:
get:
tags:
- agent
summary: Poll an answer agent run
description: Retrieve the current state of an answer agent run. Poll until status is 'completed' or 'failed'. The response includes result when status is 'completed'.
operationId: getAnswerAgentRun
parameters:
- description: The run ID from the POST /v1/agent/answer/runs response.
required: true
schema:
type: string
name: run_id
in: path
- description: 'SSE resume cursor (Accept: text/event-stream only). The stream replays events with seq greater than this value. It is equivalent to the Last-Event-ID header.'
required: false
schema:
type: integer
minimum: 0.0
name: starting_after
in: query
responses:
'200':
description: 'Current state of the agent run. With Accept: text/event-stream, the response replays and then follows the run as an SSE stream of AnswerAgentStreamEnvelope events. Use starting_after or Last-Event-ID to resume. If the stream ends without an agent_result event, poll this endpoint with Accept: application/json for the terminal status.'
content:
application/json:
schema:
$ref: '#/components/schemas/AnswerAgentRun'
text/event-stream:
schema:
$ref: '#/components/schemas/AnswerAgentStreamEnvelope'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'403':
description: The run is not owned by the caller.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'404':
description: Run not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
/v1/agent/retrieval/runs:
get:
tags:
- agent
summary: List retrieval agent runs
description: List the authenticated caller's retrieval agent runs, newest first. Returns trimmed run summaries. Fetch full detail via GET /v1/agent/retrieval/runs/{run_id}.
operationId: listRetrievalAgentRuns
parameters:
- description: Opaque pagination cursor from a previous response's next_cursor.
required: false
schema:
type: string
name: cursor
in: query
- description: Max runs to return (default 20, max 100).
required: false
schema:
type: integer
maximum: 100.0
minimum: 1.0
name: limit
in: query
responses:
'200':
description: A page of the caller's retrieval agent runs, newest first.
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievalAgentRunList'
'400':
description: Invalid pagination parameter (limit or cursor).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
post:
tags:
- agent
summary: Dispatch a retrieval agent run
description: Dispatch a retrieval agent run. Returns 202 with a RetrievalAgentRun object. Poll GET /v1/agent/retrieval/runs/{run_id} until status is 'completed' or 'failed'.
operationId: createRetrievalAgentRun
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievalAgentRunRequest'
responses:
'202':
description: 'Run dispatched. With Accept: application/json, poll GET /v1/agent/retrieval/runs/{run_id} for the run status. With Accept: text/event-stream, the response is an SSE stream of RetrievalAgentStreamEnvelope events. The stream ends at stream_done. If the stream ends without an agent_result event, poll GET /v1/agent/retrieval/runs/{run_id} for the terminal status.'
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievalAgentRun'
text/event-stream:
schema:
$ref: '#/components/schemas/RetrievalAgentStreamEnvelope'
'400':
description: Invalid request (for example, a blank query or a malformed body).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'402':
description: Insufficient API credit balance (PAYG pre-dispatch gate).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'404':
description: thread_id does not exist or is not owned by the caller.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'409':
description: 'Conflict. code is one of: ''conflict'' (the thread already has a run in flight); ''thread_product_mismatch'' (the thread belongs to a different agent product); ''source_indexes_mismatch'' (a follow-up changed the thread''s pinned source_indexes).'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'500':
description: Failed to dispatch the agent run.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
/v1/agent/retrieval/runs/{run_id}:
get:
tags:
- agent
summary: Poll a retrieval agent run
description: Retrieve the current state of a retrieval agent run. Poll until status is 'completed' or 'failed'. The response includes result when status is 'completed'.
operationId: getRetrievalAgentRun
parameters:
- description: The run ID from the POST /v1/agent/retrieval/runs response.
required: true
schema:
type: string
name: run_id
in: path
- description: 'SSE resume cursor (Accept: text/event-stream only). The stream replays events with seq greater than this value. It is equivalent to the Last-Event-ID header.'
required: false
schema:
type: integer
minimum: 0.0
name: starting_after
in: query
responses:
'200':
description: 'Current state of the agent run. With Accept: text/event-stream, the response replays and then follows the run as an SSE stream of RetrievalAgentStreamEnvelope events. Use starting_after or Last-Event-ID to resume. If the stream ends without an agent_result event, poll this endpoint with Accept: application/json for the terminal status.'
content:
application/json:
schema:
$ref: '#/components/schemas/RetrievalAgentRun'
text/event-stream:
schema:
$ref: '#/components/schemas/RetrievalAgentStreamEnvelope'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'403':
description: The run is not owned by the caller.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
'404':
description: Run not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- apiKey: []
components:
schemas:
TextEvent:
properties:
kind:
type: string
const: text
title: Kind
default: text
id:
type: string
title: Id
delta:
type: string
title: Delta
done:
type: boolean
title: Done
default: false
type: object
required:
- id
- delta
title: TextEvent
KnowledgeCardMethodology:
properties:
methodology_name:
anyOf:
- type: string
- type: 'null'
title: Methodology Name
description: The name of the methodology
examples:
- Where the Data Comes From - S&P Global
methodology_description:
anyOf:
- type: string
- type: 'null'
title: Methodology Description
description: 'A concise, one-sentence summary of the methodology: the source and what it measures. When no concise summary is available, this carries the full methodology text.'
examples:
- Financial metrics standardized by S&P Global from company regulatory filings, press releases, and restatements.
type: object
required:
- methodology_name
- methodology_description
title: KnowledgeCardMethodology
ContentsFormat:
type: string
enum:
- csv
- json_records
- json_compact
title: ContentsFormat
description: 'Serialization of tabular (Tako card) data. Web content is always raw text
and carries no content format (content_format is null).'
RetrievalAgentResult:
properties:
answer:
anyOf:
- type: string
- type: 'null'
title: Answer
cards:
items:
$ref: '#/components/schemas/TakoCard'
type: array
title: Cards
citations:
items:
$ref: '#/components/schemas/AgentAnswerCitation'
type: array
title: Citations
metadata:
anyOf:
- $ref: '#/components/schemas/AgentAnswerMetadata'
- type: 'null'
structured_output:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Structured Output
description: Caller-shaped structured output (present only if the request carried output_schema and status is not 'failed'). Dataset slots contain a TakoDataset envelope of exact retrieved rows, or null when the agent left them unfilled.
structured_output_status:
anyOf:
- $ref: '#/components/schemas/StructuredOutputStatus'
- type: 'null'
description: complete | partial | failed. Present when the request supplied output_schema and the run reached the finalize step. It can be absent when the whole run failed or timed out before finalize; the run-level status and error convey that, and the echoed request.output_schema still identifies the run as structured.
structured_output_citations:
anyOf:
- additionalProperties:
items:
type: integer
type: array
type: object
- type: 'null'
title: Structured Output Citations
description: Best-effort field-path -> citation-index map joining the top-level citations registry (same [n] index space as the answer). Absent when status is 'failed'.
unfilled_fields:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Unfilled Fields
description: Dot-separated paths of unfilled dataset slots; present only if status is 'partial'.
structured_output_error:
anyOf:
- $ref: '#/components/schemas/ErrorObject'
- type: 'null'
description: Why structured output failed; present only if status is 'failed'.
request_id:
anyOf:
- type: string
- type: 'null'
title: Request Id
type: object
title: RetrievalAgentResult
description: 'Final retrieval-agent output. answer is markdown prose with [n]
citation markers. cards reuse the sibling TakoCard. citations is the
unified top-level registry for data and web sources — there is no
web_results field. metadata carries definitions, assumptions, and
methodology. The structured_output_* fields carry the caller-shaped
output_schema result; they are present only if the request supplied
output_schema. See each field''s description for the exact presence
rules.'
RetrievalAgentRun:
properties:
run_id:
type: string
title: Run Id
object:
type: string
const: agent.retrieval.run
title: Object
default: agent.retrieval.run
thread_id:
anyOf:
- type: string
- type: 'null'
title: Thread Id
status:
$ref: '#/components/schemas/AgentRunStatus'
created_at:
type: string
title: Created At
completed_at:
anyOf:
- type: string
- type: 'null'
title: Completed At
result:
anyOf:
- $ref: '#/components/schemas/RetrievalAgentResult'
- type: 'null'
error:
anyOf:
- $ref: '#/components/schemas/ErrorObject'
- type: 'null'
usage:
anyOf:
- $ref: '#/components/schemas/Usage'
- type: 'null'
request:
anyOf:
- $ref: '#/components/schemas/RetrievalAgentRunRequest'
- type: 'null'
type: object
required:
- run_id
- status
- created_at
title: RetrievalAgentRun
description: The retrieval-agent run resource returned by dispatch (202) and poll (GET).
AgentAnswerDefinition:
properties:
term:
type: string
title: Term
definition:
type: string
title: Definition
source_ref:
anyOf:
- type: integer
- type: 'null'
title: Source Ref
type: object
required:
- term
- definition
title: AgentAnswerDefinition
AgentAnswerMetadata:
properties:
citations:
anyOf:
- items:
$ref: '#/components/schemas/AgentAnswerCitation'
type: array
- type: 'null'
title: Citations
definitions:
anyOf:
- items:
$ref: '#/components/schemas/AgentAnswerDefinition'
type: array
- type: 'null'
title: Definitions
assumptions:
anyOf:
- items:
$ref: '#/components/schemas/AgentAnswerAssumption'
type: array
- type: 'null'
title: Assumptions
methodology:
anyOf:
- items:
$ref: '#/components/schemas/AgentAnswerMethodologyNote'
type: array
- type: 'null'
title: Methodology
type: object
title: AgentAnswerMetadata
description: 'Supplementary answer metadata. All fields are optional — population
varies by effort and engine (low fills citations only today). Tako adds
new components here additively.'
ExportPricing:
properties:
baseline_usd:
type: number
title: Baseline Usd
description: Flat USD charged once per card export, independent of row count.
row_cpm_usd:
type: number
title: Row Cpm Usd
description: USD charged per 1,000 rows on rows beyond the free allowance (free_rows). Card-level total across the card's priced sources; no per-source breakdown.
free_rows:
type: integer
title: Free Rows
description: Rows included at the baseline price before the per-1,000-row rate (row_cpm_usd) begins to apply.
max_rows_ceiling:
type: integer
title: Max Rows Ceiling
description: Hard cap on rows a single export can return and bill; a larger requested max_rows is clamped to this.
type: object
required:
- baseline_usd
- row_cpm_usd
- free_rows
- max_rows_ceiling
title: ExportPricing
description: 'Card-CSV export pricing RATE, published so a caller can compute an export''s
cost before fetching. Full charge =
baseline_usd + row_cpm_usd * max(0, rows - free_rows) / 1000, rows <= max_rows_ceiling.
row_cpm_usd is the card-level total (sum of the card''s distinct priced sources''
per-1,000-row rate); no per-source breakdown.'
AgentRunStatus:
type: string
enum:
- queued
- running
- completed
- failed
title: AgentRunStatus
HeartbeatEvent:
properties:
kind:
type: string
const: heartbeat
title: Kind
default: heartbeat
type: object
title: HeartbeatEvent
SubagentEvent:
properties:
kind:
type: string
const: subagent
title: Kind
default: subagent
agent_id:
type: string
title: Agent Id
subagent_type:
type: string
title: Subagent Type
parent_id:
anyOf:
- type: string
- type: 'null'
title: Parent Id
event:
type: string
enum:
- dispatch
- complete
title: Event
type: object
required:
- agent_id
- subagent_type
- event
title: SubagentEvent
TakoDatasetColumn:
properties:
name:
type: string
title: Name
description: Column name.
type:
$ref: '#/components/schemas/TakoDatasetColumnType'
description: 'Logical column type: ''string'', ''number'', ''boolean'', ''date'', or ''datetime''. Temporal cells are ISO-8601 strings.'
type: object
required:
- name
- type
title: TakoDatasetColumn
description: Typed header entry; `type` is the JSON-facing column type.
GraphNodeType:
type: string
enum:
- metric
- entity
title: GraphNodeType
AgentOutputSettings:
properties:
image_dark_mode:
anyOf:
- type: boolean
- type: 'null'
title: Image Dark Mode
description: Render card preview images in dark mode. Omit to use the default (dark).
type: object
title: AgentOutputSettings
AnswerAgentEffort:
type: string
enum:
- medium
title: AnswerAgentEffort
description: 'Effort taxonomy for the Answer Agent (POST /v1/agent/answer/runs).
The Answer Agent shares the effort vocabulary with the Retrieval Agent,
but only ''medium'' is available today. Unsupported values return 400.
Effort does not select an engine; it is a forward-compatible quality and
pricing control.'
RetrievalAgentRunSummary:
properties:
run_id:
type: string
title: Run Id
status:
$ref: '#/components/schemas/AgentRunStatus'
created_at:
type: string
title: Created At
completed_at:
anyOf:
- type: string
- type: 'null'
title: Completed At
thread_id:
anyOf:
- type: string
- type: 'null'
title: Thread Id
usage:
anyOf:
- $ref: '#/components/schemas/Usage'
- type: 'null'
object:
type: string
const: agent.retrieval.run
title: Object
default: agent.retrieval.run
type: object
required:
- run_id
- status
- created_at
title: RetrievalAgentRunSummary
ToolCallEvent:
properties:
kind:
type: string
const: tool_call
title: Kind
default: tool_call
id:
type: string
title: Id
tool:
type: string
title: Tool
status_message:
anyOf:
- type: string
- type: 'null'
title: Status Message
parent_id:
anyOf:
- type: string
- type: 'null'
title: Parent Id
done:
type: boolean
title: Done
default: false
type: object
required:
- id
- tool
title: ToolCallEvent
UsageData:
properties:
cost_usd:
type: number
title: Cost Usd
description: USD cost of the inline data delivered in the response.
datasets:
type: integer
title: Datasets
description: Number of billed data units (datasets) included in the response.
type: object
required:
- cost_usd
- datasets
title: UsageData
description: 'The cost and quantity of inline data delivered in the response: the
agent per-dataset surcharge, the search and answer include_contents
charge, or the contents per-item cost. `datasets` is the count of billed
data units. Absent when the surface did not or cannot emit inline data
(for example, the answer agent).'
TakoCardSource:
properties:
source_name:
anyOf:
- type: string
- type: 'null'
title: Source Name
description: The name of the source
examples:
- S&P Global
- The World Bank
source_description:
anyOf:
- type: string
- type: 'null'
title: Source Description
description: The description of the source
source_index:
$ref: '#/components/schemas/TakoSourceIndex'
description: The index of the source
examples:
- data
- web
url:
anyOf:
- type: string
- type: 'null'
title: Url
description: The URL of the source
examples:
- https://xignite.com
source_text:
anyOf:
- type: string
- type: 'null'
title: Source Text
description: Raw excerpts retrieved from the source page — the unmodified web content that grounded the answer. Present for WEB sources; null for DATA sources.
type: object
required:
- source_index
title: TakoCardSource
description: 'A source that backs a TakoCard on the SDK surfaces. It uses the
{data, web} TakoSourceIndex taxonomy.'
Usage:
properties:
total_cost_usd:
type: number
title: Total Cost Usd
description: Total quoted USD cost of this request. Sum of compute cost and data cost.
compute:
anyOf:
- $ref: '#/components/schemas/UsageCompute'
- type: 'null'
description: Compute cost breakdown. Present only on surfaces with a compute step (absent for contents).
data:
anyOf:
- $ref: '#/components/schemas/UsageData'
- type: 'null'
description: Inline-data cost breakdown. Present only when the surface emitted billable inline data.
type: object
required:
- total_cost_usd
title: Usage
description: 'Usage for one metered request. `total_cost_usd` is always present (the
total quoted charge). `compute` and `data` are the additive breakdown;
each appears only where it applies. total_cost_usd always equals the sum
of the components that appear.'
UsageCompute:
properties:
cost_usd:
type: number
title: Cost Usd
description: USD cost of running the operation.
type: object
required:
- cost_usd
title: UsageCompute
description: 'The cost of running the operation. Absent on surfaces with no compute
step (contents).'
ReasoningEvent:
properties:
kind:
type: string
const: reasoning
title: Kind
default: reasoning
id:
type: string
title: Id
delta:
type: string
title: Delta
done:
type: boolean
title: Done
default: false
type: object
required:
- id
- delta
title: ReasoningEvent
TakoDatasetColumnType:
type: string
enum:
- string
- number
- boolean
- date
- datetime
title: TakoDatasetColumnType
description: 'Logical column type declared in a TakoDataset header. Temporal cells
are ISO-8601 strings. Each column declares ''date'' or ''datetime'' on its
own: a temporal column whose non-null values are all timezone-naive
midnights declares ''date''.'
ToolRetryEvent:
properties:
kind:
type: string
const: tool_retry
title: Kind
default: tool_retry
id:
type: string
title: Id
tool:
type: string
title: Tool
error:
type: string
title: Error
elapsed_ms:
type: integer
title: Elapsed Ms
default: 0
parent_id:
anyOf:
- type: string
- type: 'null'
title: Parent Id
type: object
required:
- id
- tool
- error
title: ToolRetryEvent
StreamResetEvent:
properties:
kind:
type: string
const: stream_reset
title: Kind
default: stream_reset
type: object
title: StreamResetEvent
AnswerAgentRunRequest:
properties:
query:
type: string
title: Query
description: Natural-language request for the answer agent.
examples:
- How have American Airlines' margins held up against fuel shocks?
thread_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Thread Id
description: Existing thread to continue (follow-up). Omit to start a new thread.
effort:
$ref: '#/components/schemas/AnswerAgentEffort'
description: Answer-agent effort. Only 'medium' is currently supported.
default: medium
source_indexes:
items:
type: string
enum:
- data
- web
type: array
title: Source Indexes
description: 'Which sources the agent may use: ''data'' (curated knowledge), ''web'' (open-web search), or both. Defaults to [''data'', ''web'']. Tako accepts the legacy value ''tako'' as a synonym for ''data''.'
examples:
- - data
- - web
- - data
- web
locale:
type: string
title: Locale
description: BCP-47 locale. Drives the language of the agent's answer and the locale used when rendering card preview images. Defaults to en-US.
default: en-US
timezone:
anyOf:
- type: string
- type: 'null'
title: Timezone
description: IANA timezone (for example, 'America/New_York'). The agent uses it to render dates and times in card preview images. It does not affect the returned data.
output_settings:
anyOf:
- $ref: '#/components/schemas/AgentOutputSettings'
- type: 'null'
description: Settings that control the response and rendering.
type: object
required:
- query
title: AnswerAgentRunRequest
description: 'Request body for POST /v1/agent/answer/runs.
Frozen contract: no output_schema, no structured outputs, and no inline
data — ever. Cards are
# --- truncated at 32 KB (67 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tako/refs/heads/main/openapi/tako-agent-api-openapi.yml