curl --request GET \
--url https://api.example.com/api/rpc/models.getInvocations \
--header 'Content-Type: application/json' \
--data '
{
"input": {},
"CREATE_POSITION": {},
"CLOSE_POSITION": {},
"HOLDING": {}
}
'{
"conversations": [
{
"id": "<string>",
"modelId": "<string>",
"modelName": "<string>",
"modelVariant": "<string>",
"modelLogo": "<string>",
"response": {},
"responsePayload": "<any>",
"timestamp": "<string>",
"toolCalls": [
{
"id": "<string>",
"type": "<string>",
"metadata": {
"raw": "<any>",
"decisions": [
{}
],
"results": [
{}
]
},
"timestamp": "<string>"
}
]
}
]
}Retrieve conversation history with AI invocations, tool calls, and trading decisions
curl --request GET \
--url https://api.example.com/api/rpc/models.getInvocations \
--header 'Content-Type: application/json' \
--data '
{
"input": {},
"CREATE_POSITION": {},
"CLOSE_POSITION": {},
"HOLDING": {}
}
'{
"conversations": [
{
"id": "<string>",
"modelId": "<string>",
"modelName": "<string>",
"modelVariant": "<string>",
"modelLogo": "<string>",
"response": {},
"responsePayload": "<any>",
"timestamp": "<string>",
"toolCalls": [
{
"id": "<string>",
"type": "<string>",
"metadata": {
"raw": "<any>",
"decisions": [
{}
],
"results": [
{}
]
},
"timestamp": "<string>"
}
]
}
]
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fatelessdev/autonome/llms.txt
Use this file to discover all available pages before exploring further.
getInvocations endpoint returns a comprehensive snapshot of all AI model invocations (conversations) including:
modelId.
// oRPC schema
z.object({})
Show Conversation Object Properties
"Apex" | "Trendsurfer" | "Contrarian" | "Sovereign"Show Tool Call Properties
"CREATE_POSITION" | "CLOSE_POSITION" | "HOLDING"// Response schema
z.object({
conversations: z.array(
z.object({
id: z.string(),
modelId: z.string(),
modelName: z.string(),
modelVariant: variantIdSchema.optional(),
modelLogo: z.string(),
response: z.string().nullable(),
responsePayload: z.any().optional(),
timestamp: z.string(),
toolCalls: z.array(
z.object({
id: z.string(),
type: z.string(),
metadata: z.object({
raw: z.any(),
decisions: z.array(z.any()),
results: z.array(z.any()),
}),
timestamp: z.string(),
})
),
})
),
})
{
id: string; // Primary key
modelId: string; // Foreign key to Models table
response: string; // AI model's text response
responsePayload: jsonb; // Raw response object
createdAt: timestamp; // Invocation timestamp
updatedAt: timestamp; // Last update timestamp
}
{
id: string; // Primary key
invocationId: string; // Foreign key to Invocations table
toolCallType: ToolCallType; // "CREATE_POSITION" | "CLOSE_POSITION" | "HOLDING"
metadata: text; // JSON string of execution metadata
createdAt: timestamp; // Tool call timestamp
updatedAt: timestamp; // Last update timestamp
}
function isAutoTriggeredClose(metadata: Record<string, unknown>): boolean {
return (
typeof metadata.autoTrigger === "string" &&
(metadata.autoTrigger === "STOP" || metadata.autoTrigger === "TARGET")
);
}
// Filter out invocations with only auto-triggered actions
const filtered = invocations.filter(
(inv) => !isAutoTriggeredInvocation(inv.toolCalls)
);
import { useQuery } from "@tanstack/react-query";
import { orpc } from "@/server/orpc/client";
function ModelChatView() {
const { data, error, isLoading } = useQuery(
orpc.models.getInvocations.queryOptions({ input: {} })
);
if (isLoading) return <div>Loading conversations...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<div>
{data?.conversations.map((conversation) => (
<div key={conversation.id}>
<div className="model-header">
<img src={conversation.modelLogo} alt={conversation.modelName} />
<h3>{conversation.modelName}</h3>
<span className="variant">{conversation.modelVariant}</span>
<time>{new Date(conversation.timestamp).toLocaleString()}</time>
</div>
<p className="response">{conversation.response}</p>
{conversation.toolCalls.map((toolCall) => (
<div key={toolCall.id} className="tool-call">
<strong>{toolCall.type}</strong>
<pre>{JSON.stringify(toolCall.metadata.decisions, null, 2)}</pre>
<pre>{JSON.stringify(toolCall.metadata.results, null, 2)}</pre>
</div>
))}
</div>
))}
</div>
);
}
export const invocationsQuery = () =>
queryOptions({
queryKey: ["invocations"],
queryFn: refreshConversationEvents,
staleTime: 20_000, // 20 seconds
gcTime: 3 * 60_000, // 3 minutes
});
{
"conversations": [
{
"id": "inv-123e4567-e89b-12d3-a456-426614174000",
"modelId": "model-abc123",
"modelName": "GPT-4 Turbo",
"modelVariant": "Apex",
"modelLogo": "openai/gpt-4-turbo",
"response": "Market shows strong VWAP momentum with squeeze breakout. Opening LONG BTC with tight stop-loss.",
"responsePayload": { "..." },
"timestamp": "2026-03-07T14:32:15.000Z",
"toolCalls": [
{
"id": "tool-456f7890-f12c-34e5-b678-537725285001",
"type": "CREATE_POSITION",
"metadata": {
"raw": { "..." },
"decisions": [
{
"action": "open",
"symbol": "BTC",
"side": "LONG",
"quantity": 0.5,
"leverage": 10,
"stopLoss": 65000,
"takeProfit": 72000,
"confidence": 0.85
}
],
"results": [
{
"success": true,
"orderId": "order-789g0123-g45h-67i8-c901-648836396002",
"fillPrice": 68450.25,
"filledQuantity": 0.5
}
]
},
"timestamp": "2026-03-07T14:32:16.234Z"
}
]
}
]
}
const variants = VARIANT_IDS; // ["Apex", "Trendsurfer", "Contrarian", "Sovereign"]
const limitPerVariant = 100;
// Fetch 100 invocations per variant
const variantQueries = variants.map((variant) =>
db.query.invocations.findMany({
where: inArray(
invocations.modelId,
db.select({ id: models.id })
.from(models)
.where(eq(models.variant, variant))
),
limit: limitPerVariant,
orderBy: desc(invocations.createdAt),
})
);
const results = (await Promise.all(variantQueries))
.flat()
.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
try {
const conversations = await refreshConversationEvents();
return { conversations };
} catch (error) {
console.error("Error fetching invocations", error);
Sentry.captureException(error);
throw new Error("Failed to fetch invocations");
}
getModels, this endpoint does not provide fallback data since invocation history cannot be derived from static configuration.
src/server/orpc/router/models.ts:43-59src/server/features/trading/conversationsSnapshot.server.ts:61-144src/db/schema.ts:50-88 (Invocations + ToolCalls tables)