Choosing a payload format
Your agent can submit strategies in two formats:- SignalGraph — recommended for AI agents. It’s higher-level, easier to generate, and simpler to repair when validation fails.
- StrategyAst — the canonical format. Use this if your agent already produces it directly.
Minimum scopes
For an autonomous agent that validates, writes strategies, and runs backtests, the recommended minimum scopes are:workspace_readstrategies_writebacktests_writebacktests_read
strategies_readUseful if your agent needs to inspect existing strategies and versions.system_strategies_readUseful if your agent starts from built-in templates.
Recommended request sequence
GET /public/v1Read the manifest and discover the workflow contract.GET /public/v1/workspaceInspect workspace identity, API key scopes, and subscription tier.GET /public/v1/capabilitiesFetch machine-readable indicators, node inputs, bindings, operators, tier limits, and validation issue shape before authoring a payload.POST /public/v1/strategies/validateValidate the draft payload and repair it untilvalid === true.POST /public/v1/strategiesCreate a draft strategy.POST /public/v1/strategies/:id/versions/finalizePromote a version toready.POST /public/v1/backtestsQueue a backtest.GET /public/v1/backtests/:idPoll until the backtest reaches a terminal state.
Discovering capabilities
Always callGET /public/v1/capabilities before your agent writes a strategy.
This endpoint returns everything your agent needs to know about what’s
supported:
- available indicators and their parameters
- supported node kinds and bindings for SignalGraph
- operators, enums (timeframes, market fields, patterns)
- plan-specific limits
- the validation issue format (
code,path,message,suggestion)
Structured validation issues
POST /public/v1/strategies/validate returns machine-readable issues. Token,
AST, and graph validation issues now include:
codepathmessagesuggestion
- Generate
signalGraphorstrategyAst. - Validate.
- Group issues by
severity. - Repair the payload using
code,path, andsuggestion. - Revalidate until blocking issues are gone.
cURL example
Ready-to-use assets
Two reference files are available to help you get started:traseq-agent-tool-schema.json— a tool contract for the public API, ready to use with tool-enabled AI agents.traseq-agent-example.ts— a minimal TypeScript client with a validate-repair loop helper.
TypeScript SDK example
Here’s the core pattern for building an agent client. Seetraseq-agent-example.ts for a full working version.
- read workspace and capabilities
- generate
signalGraph - validate
- repair
- create
- finalize
- backtest
Agent tool schema
Instead of giving your AI model raw HTTP access, wrap the API in a structured tool layer. Seetraseq-agent-tool-schema.json for the full JSON definition.
Recommended tools:
get_manifestget_workspace_contextget_capabilitiesvalidate_strategycreate_strategyfinalize_strategy_versionrun_backtestget_backtest
validate_strategy input shape:
Suggested system prompt
Give your AI model a system prompt that enforces the capability contract and validate-repair loop.Repair loop template
When validation fails, repair the specific issues rather than regenerating the entire strategy. Here’s a template for a deterministic repair loop.Tips
- Start simple. One trigger plus one confirmation filter is much easier to repair than a complex multi-branch graph.
- Cache capabilities. Cache the response from
GET /public/v1/capabilitiesper workspace tier, and refresh when the subscription changes. - Use issue codes for repairs. Deterministic repair rules based on
issue.codeare more reliable than asking the model to reinterpret error messages. - Fix errors first, warnings second. Feed the repair loop only blocking issues initially — handle warnings in a second pass once the payload is valid.