Connect Altruist Open API to AI Agents: Sync Feeds & Position Data
Give your AI agent Altruist Open API tools.
Connect the Altruist Open API to AI agents to autonomously sync financial feeds, cost basis, and position data. This guide covers bypassing Altruist's API quirks, handling strict rate limits, and binding tools in frameworks like LangChain.
In this guide
- 01Configure Altruist Integration in Truto
- 02Fetch AI-Ready Tools
- 03Bind Tools to the Agent Framework
- 04Implement Rate Limit Backoff
- 05Execute Multi-Step Workflows
The guide
Learn how to connect the Altruist Open API to AI agents using Truto's /tools endpoint. Build autonomous workflows to sync positions, transactions, and data feeds.
You want to connect the Altruist Open API to an AI agent so your system can autonomously read household data, sync cost basis information, generate historical data files, and manage custodial data feeds. Here is exactly how to do it using Truto's /tools endpoint and SDK, bypassing the need to build and maintain a custom financial data integration from scratch.
Giving a Large Language Model (LLM) read and write access to a custodial wealth management platform requires precision. You cannot afford hallucinated payloads, missed pagination cursors, or ignored rate limits when dealing with financial transactions and position data. If your team uses ChatGPT, check out our guide on connecting Altruist Open API to ChatGPT, or if you are building on Anthropic's models, read our guide on connecting Altruist Open API to Claude. For developers building custom autonomous workflows, you need a programmatic, highly deterministic way to fetch these tools and bind them to your agent framework.
This guide breaks down exactly how to fetch AI-ready tools for the Altruist Open API, bind them natively to an LLM using frameworks like LangChain, LangGraph, CrewAI, or the Vercel AI SDK, and execute complex wealth tech workflows. For a broader look at this architectural design pattern, read our research on Architecting AI Agents: LangGraph, LangChain, and the SaaS Integration Bottleneck.
The Engineering Reality of the Altruist Open API
Giving an AI agent access to external data sounds trivial in a prototype. You write a standard Node.js fetch wrapper, annotate it with an @tool decorator, and hand it to the model. In production - especially against a financial data custodian like Altruist - this naive approach collapses almost immediately.
If you hardcode these interactions into your agent's source code, you will spend all your development cycles writing defensive integration code instead of improving the actual reasoning capabilities of your LLM. The Altruist Open API introduces several specific integration challenges that will break standard REST assumptions if not abstracted properly.
Challenge 1: The v1 to v2 Deprecation Churn
Altruist is actively evolving its API surface. Currently, they are deprecating several major v1 endpoints in favor of their v2 equivalents. For instance, the original endpoint for listing accounts or positions is being sunset, replaced by strictly enforced v2 methods (e.g., accounts.list or positions.list).
If you feed raw OpenAPI specs into an LLM, the model will often arbitrarily choose between the v1 and v2 endpoints, leading to sudden tool failures when the legacy endpoints are finally disabled. A dedicated Proxy API layer solves this by only exposing the validated, current-version tools to the agent, completely shielding the model from underlying version deprecation churn.
Challenge 2: Strict Pagination Boundaries
Financial APIs return massive datasets. A single household might have multiple accounts, each with hundreds of active positions and thousands of historical transactions.
Altruist handles this via strict page and page-size parameters. The default response limit is 100 records, and they enforce a hard cap of 1,000 records per request. Standard LLMs are notoriously bad at pagination. If asked to "get all transactions," an unconstrained agent might attempt to pass a payload like {"page_size": 50000}, which the Altruist API will reject outright with a 400 Bad Request. By abstracting the endpoint into a tool layer, you enforce strict integer boundaries in the JSON schema before the payload ever reaches the network.
Challenge 3: HTTP 429s and Transparent Rate Limiting
Custodial platforms aggressively rate limit API consumers to ensure platform stability. When building an agent, you must account for HTTP 429 Too Many Requests errors.
It is vital to understand that Truto does not retry, throttle, or apply backoff on rate limit errors. When Altruist returns an HTTP 429, Truto passes that error directly back to the caller. However, Truto does the heavy lifting of normalizing Altruist's specific rate limit headers into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). This means your agent execution loop does not need to parse vendor-specific error payloads; it simply catches the 429, reads the standard ratelimit-reset timestamp, suspends agent execution, and retries when the window clears.
Essential Tools for Altruist Open API AI Agents
Truto maps underlying Altruist endpoints into standardized Proxy APIs, which are then exposed as highly constrained LLM tools. Because Truto handles the authentication, schema definition, and payload validation, the LLM only has to decide which tool to use and what parameters to pass.
Here are the highest-leverage hero tools for automating wealth management workflows with Altruist Open API.
List All Households
Before an agent can query specific financial data, it usually needs to resolve a client's name or identity to a specific household_id. This tool allows the agent to search and filter households by name.
Tool name: list_all_altruist_open_api_households
Contextual usage notes: The agent can pass a name_pattern to filter results (case-insensitive). The response returns an array of household records. The agent will extract the id from this response to feed into downstream account queries.
"Find the household ID for the 'Miller Family Trust' and list their details."
List All Accounts
Once a household is identified, the agent must determine which specific trading or retirement accounts belong to that household.
Tool name: list_all_altruist_open_api_accounts
Contextual usage notes: This tool strictly requires a household_id. It maps to Altruist's v2 account listing method. The agent should use this to discover account_id values, which are mandatory for fetching positions or cost basis data.
"List all active accounts associated with household ID 9482."
List All Positions
This is the core tool for portfolio analysis. It retrieves the most recent holdings for a specified account.
Tool name: list_all_altruist_open_api_positions
Contextual usage notes: Requires an account_id. The response contains the positions array. If the agent needs to analyze a massive portfolio, it must manage the page parameter, keeping page_size at or below 1000.
"Get the current positions for account ID 392A and calculate the total exposure to technology equities."
List All Transactions
For reconciliation, audit, or performance reporting, the agent needs historical ledger data.
Tool name: list_all_altruist_open_api_transactions
Contextual usage notes: Requires an account_id. By default, if date bounds are not provided, it fetches the last month of activity. The agent can supply date_from and date_to in YYYY-MM-DD format to query specific historical periods.
"Pull all transactions for account ID 392A between January 1, 2024, and March 31, 2024, and filter for dividend payouts."
Get Cost Basis
Tax-loss harvesting and capital gains reporting require precise cost basis data. This tool extracts the current tax lots and basis data for a specific account.
Tool name: list_all_altruist_open_api_cost_basis
Contextual usage notes: Requires an account_id. This maps to the v2 endpoint, returning the data necessary for the agent to compute unrealized gains or losses across the account's holdings.
"Retrieve the cost basis for account ID 392A and identify any positions with an unrealized loss greater than 10 percent."
Create Data Feed
For data engineering teams managing firm-wide analytics, daily flat files are crucial. This tool allows an agent to programmatically toggle on the custodial data feed for the signed-in advisor's firm.
Tool name: create_a_altruist_open_api_data_feed
Contextual usage notes: Requires a partner_code (provided by Altruist) and a boolean file_transfer payload to enable the feed. This is a high-leverage administrative action that saves operations teams from clicking through UI settings.
"Enable the daily custodial data feed for our firm using partner code PRT-992."
To see the full list of available operations, required parameters, and complete JSON schemas, refer to the Altruist integration page.
Workflows in Action
Single tool calls are useful for basic retrieval, but the real power of AI agents lies in chaining these operations together to execute complex, multi-step wealth management tasks autonomously.
Here is how an agent orchestrates Altruist Open API tools in real-world scenarios.
Scenario 1: The Automated Portfolio Review
Wealth advisors spend hours compiling portfolio summaries before client meetings. An AI agent can automate this data gathering instantly.
"Find the household for 'Sarah Jenkins', locate her primary IRA account, and generate a summary of her current positions alongside any trades executed in the last 30 days."
list_all_altruist_open_api_households: The agent passesname_pattern: "Sarah Jenkins"to find the correspondinghousehold_id. It parses the response and identifies ID8821.list_all_altruist_open_api_accounts: The agent calls this tool withhousehold_id: 8821to fetch the list of accounts, identifying the account tagged as an IRA (Account IDIRA-443).list_all_altruist_open_api_positions: Using Account IDIRA-443, the agent retrieves the current list of holdings.list_all_altruist_open_api_transactions: Finally, the agent queries transactions forIRA-443, relying on the default 30-day lookback window.
Outcome: The agent returns a highly structured, accurate summary of the client's current financial standing, ready to be dropped into a meeting brief or CRM note.
Scenario 2: Tax-Loss Harvesting Identification
Identifying tax-loss harvesting opportunities across a client base requires comparing current market value against the historical cost basis.
"Check the cost basis for all accounts belonging to the 'Henderson Trust' and flag any individual tax lots that currently show a short-term capital loss."
list_all_altruist_open_api_households: The agent searches for "Henderson Trust" to retrieve thehousehold_id.list_all_altruist_open_api_accounts: The agent fetches all accounts associated with that household.list_all_altruist_open_api_cost_basis: For each account retrieved in step 2, the agent loops through and executes the cost basis tool. It parses the resultingdata.cost_basisarrays.
Outcome: The agent cross-references the acquisition dates and current basis, outputting a precise list of ticker symbols, account IDs, and loss amounts that the advisor can act on.
Scenario 3: Data Engineering Backfill Operations
When onboarding a new sub-advisor or reconciling historical models, data engineering teams often need to trigger asynchronous data file generation.
"Request the historical data file for rep code 774B using partner code XYZ-123, and confirm if their daily data feed is currently active."
create_a_altruist_open_api_historical_data_file: The agent sends the request containing therepcodesarray and thepartner_codeto initiate Altruist's file generation process.list_all_altruist_open_api_data_feeds: The agent checks the current active feeds for thatpartner_codeto verify the status of the daily file transfer.
Outcome: The operations team gets immediate confirmation that historical data is processing and that the daily delta feeds are correctly configured, without logging into an admin portal.
Building Multi-Step Workflows
To build these autonomous systems, you need a reliable way to load the Altruist Open API schemas into your agent and execute them safely.
Truto provides a seamless /tools endpoint that auto-generates LLM-ready schemas. This approach is completely framework-agnostic. Whether you use LangChain, LangGraph, CrewAI, or the Vercel AI SDK, you simply fetch the tools and bind them to the model.
Here is the architectural flow of how a tool call works in a multi-step agent loop:
sequenceDiagram
participant Agent as AI Agent Framework
participant Truto as Truto Tool Manager
participant Altruist as Altruist Open API
Agent->>Truto: GET /integrated-account/{id}/tools
Truto-->>Agent: Return normalized JSON schema tools
Agent->>Agent: Bind tools to LLM (e.g. GPT-4, Claude)
Agent->>Truto: Execute list_all_altruist_open_api_positions
Truto->>Altruist: Proxy GET /v2/positions
Altruist-->>Truto: Return paginated positions
Truto-->>Agent: Return standardized tool responseCode Implementation: Binding and Execution
The following TypeScript example demonstrates how to use the @trutohq/truto-langchainjs-toolset to fetch the Altruist tools, bind them to an OpenAI model, and execute a workflow.
Crucially, this code includes explicit handling for HTTP 429 rate limit errors. Remember, Truto does not swallow or automatically retry these errors - you must implement the backoff logic using the standardized ratelimit-reset header.
import { ChatOpenAI } from "@langchain/openai";
import { TrutoToolManager } from "@trutohq/truto-langchainjs-toolset";
import { HumanMessage } from "@langchain/core/messages";
async function runAltruistAgent() {
// 1. Initialize the LLM
const llm = new ChatOpenAI({
modelName: "gpt-4o",
temperature: 0,
});
// 2. Initialize the Truto Tool Manager for the specific Altruist integration
const trutoManager = new TrutoToolManager({
trutoApiKey: process.env.TRUTO_API_KEY!,
integratedAccountId: process.env.ALTRUIST_ACCOUNT_ID!,
});
// 3. Fetch the dynamically generated tools from Truto
const tools = await trutoManager.getTools();
console.log(`Successfully loaded ${tools.length} Altruist tools.`);
// 4. Bind the tools to the LLM
const llmWithTools = llm.bindTools(tools);
// 5. Provide the prompt
const messages = [new HumanMessage("Get the cost basis for account ID ACC-9912.")];
try {
// 6. Execute the agent request
const aiMessage = await llmWithTools.invoke(messages);
messages.push(aiMessage);
// 7. Check if the LLM decided to call a tool
if (aiMessage.tool_calls && aiMessage.tool_calls.length > 0) {
for (const toolCall of aiMessage.tool_calls) {
console.log(`Executing tool: ${toolCall.name}`);
const selectedTool = tools.find((t) => t.name === toolCall.name);
if (!selectedTool) continue;
// 8. Invoke the tool with the LLM-generated arguments
const toolResult = await selectedTool.invoke(toolCall.args);
console.log("Tool execution successful:", toolResult);
}
}
} catch (error: any) {
// 9. Mandatory Rate Limit Handling (HTTP 429)
if (error.response && error.response.status === 429) {
const resetTime = error.response.headers['ratelimit-reset'];
console.warn(`Rate limit exceeded! Altruist Open API limits reached.`);
console.warn(`Agent must back off until timestamp: ${resetTime}`);
// Implement your application's specific sleep/backoff logic here
// e.g., await sleepUntil(resetTime);
} else {
console.error("Agent execution failed:", error.message);
}
}
}
runAltruistAgent();By leveraging the TrutoToolManager, you eliminate the need to write JSON schemas, manage authentication headers, or build proxy wrappers for the Altruist API. If Altruist updates a description or changes a parameter requirement in the future, Truto's /tools endpoint updates the schema automatically. The next time your agent boots up and fetches the tools, it inherently understands the new API rules.
Unblocking Wealth Tech AI Workflows
Connecting the Altruist Open API to AI agents shouldn't require sprints of custom integration work. When you build point-to-point connections, you take on the burden of managing API version deprecations, reverse-engineering pagination limits, and constantly updating the LLM prompts to handle schema drift.
A unified tool layer abstracts these infrastructure problems away. By exposing Altruist through Truto's Proxy APIs, your agent interacts with a stable, LLM-optimized interface. You enforce strict validation boundaries before data hits the network, dramatically reducing hallucination risk and ensuring your AI workflows execute safely in production.
FAQ
- How do I connect the Altruist Open API to an AI agent?
- You can connect the Altruist Open API to an AI agent by using Truto's /tools endpoint. This provides standardized, LLM-ready JSON schemas for Altruist endpoints, allowing you to bind them directly to your agent using frameworks like LangChain or the Vercel AI SDK.
- Does Truto automatically handle Altruist Open API rate limits?
- No. Truto normalizes Altruist's rate limit information into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) and passes HTTP 429 errors directly back to the caller. Your AI agent or application must implement the necessary retry and backoff logic.
- Can I use these Altruist tools with any AI framework?
- Yes. Truto's Proxy APIs return standard JSON schemas that are entirely framework-agnostic. You can bind them to LangChain, LangGraph, CrewAI, Vercel AI SDK, or custom-built agent architectures.