Chat API
Integrate conversational AI tax assistance into your application with streaming responses.
/v1/chatSend messages to AI tax agents and receive streaming responses in real-time.
Request Parameters
messages (required)
Array of message objects with role and content
agent (optional)
Agent name: Sophie, Leo, Riley, Kai, Jordan. Default: Sophie
model (optional)
AI model: openai/gpt-4o-mini, openai/gpt-4o. Default: gpt-4o-mini
Example Request
curl https://api.taxu.io/v1/chat \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "Can I deduct my home office expenses?"
}
],
"agent": "Riley"
}'Response (Streaming)
The API returns a streaming text response. Each chunk is sent as plain text:
Yes, you can deduct home office expenses if you meet certain criteria...Available Agents
Sophie - Filing Assistant
Friendly and patient, helps with tax filing basics and explains complex concepts simply.
Jordan - Deduction Detective
Analytical expert who finds every legitimate deduction and credit opportunity.
Kai - Audit Shield
Meticulous specialist focused on minimizing audit risk and ensuring compliance.
Riley - Business Tax Pro
Savvy business tax specialist for self-employment and corporate structures.
Leo - Tax Strategist
Sophisticated planner for long-term tax optimization and wealth management.
Integration Example
// JavaScript/Node.js example with streaming
const response = await fetch('https://api.taxu.io/v1/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
messages: [
{ role: 'user', content: 'What deductions can I claim?' }
],
agent: 'Riley'
})
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
console.log(chunk); // Process each chunk as it arrives
}