Overview
The primary endpoint for sending financial analysis queries. Send a conversation history and receive intelligent responses backed by comprehensive financial data with citations.
Request
Conversation history with role and content The role of the message sender. Can be user or assistant
The content of the message
Enable Server-Sent Events streaming for real-time responses
Filter results by specific criteria Array of stock ticker symbols (e.g., ["TSLA", "AAPL"])
Array of document types to search. Options: 10-K, 10-Q, 8-K, EARNINGS_CALL
Date range filter with start and end fields (ISO 8601 format)
Include detailed citation information in the response
Request Example
curl -X POST https://api.fintool.com/v2/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "What was Tesla' \' 's revenue in Q4 2024?"
}
],
"stream": false,
"filters": {
"tickers": ["TSLA"],
"doc_types": ["10-K", "10-Q", "8-K"]
}
}'
Response
Unique identifier for the message
ISO 8601 timestamp of when the message was created
The type of response, typically "message"
The assistant’s response message Always "assistant" for responses
The response content with inline citation markers in the format **[chunk_id]**
Encoded session data to maintain conversation context. Return this in subsequent requests.
Array of citation objects providing source information Unique identifier for the cited chunk
Title of the source document
Page number in the source document
Relevance score (0-1) indicating how relevant the chunk is to the query
Response Example
{
"id" : "msg_abc123" ,
"createdAt" : "2025-01-21T18:25:09Z" ,
"type" : "message" ,
"message" : {
"role" : "assistant" ,
"content" : "Tesla's Q4 2024 revenue was $25.2 billion **[tesla_10k_2024_revenue]**" ,
"metadata" : {
"session_data" : "eyJzZXNzaW9uX2lkIjoi..."
}
},
"citations" : [
{
"chunk_id" : "tesla_10k_2024_revenue" ,
"document_title" : "Tesla Inc. Form 10-K" ,
"page_number" : 42 ,
"relevance_score" : 0.95
}
]
}
Multi-turn Conversations
To maintain conversation context across multiple requests, include the session_data from the previous response in your message metadata:
{
"messages" : [
{
"role" : "user" ,
"content" : "What was Tesla's revenue in Q4 2024?"
},
{
"role" : "assistant" ,
"content" : "Tesla's Q4 2024 revenue was $25.2 billion **[tesla_10k_2024_revenue]**" ,
"metadata" : {
"session_data" : "eyJzZXNzaW9uX2lkIjoi..."
}
},
{
"role" : "user" ,
"content" : "How does that compare to Q3?"
}
]
}
Always include the session_data from previous responses to maintain conversation context and get more accurate answers.
Handling Citations
Citation markers appear in the content as **[chunk_id]**. Parse these to:
Extract the chunk_id
Find the corresponding citation in the citations array
Display source information to users
Link to the original document
Example parsing:
import re
content = response[ 'message' ][ 'content' ]
citations_map = {c[ 'chunk_id' ]: c for c in response[ 'citations' ]}
# Find all citation markers
citation_ids = re.findall( r ' \*\*\[ ([ ^ \] ] + ) \]\*\* ' , content)
for cid in citation_ids:
citation = citations_map.get(cid)
if citation:
print ( f "Source: { citation[ 'document_title' ] } , Page { citation[ 'page_number' ] } " )
Error Responses
400 Bad Request
401 Unauthorized
429 Rate Limit Exceeded
{
"error" : {
"code" : "invalid_request" ,
"message" : "Missing required field: messages"
}
}