Skip to content

AI Chat

POST
/api/v1/ai/chat
curl --request POST \
--url https://indepai.app/api/v1/ai/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "message": "How can I optimize my savings rate for FIRE?", "conversationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "category": "fi-planning", "snapshotId": "example", "enabledToolIds": [ "get_city_costs", "calculate_fire_number" ] }'

Send a message to the AI financial coach. Returns a streamed response. Subject to monthly AI rate limits based on subscription tier.

Media typeapplication/json
object
message
required

User message to the AI coach

string
>= 1 characters <= 2000 characters
Example
How can I optimize my savings rate for FIRE?
conversationId

Existing conversation ID for follow-up messages

string format: uuid
category

AI coach category for context

string
Example
fi-planning
snapshotId

AI FI Snapshot hash to attach as source-of-truth context for money-snapshot questions

string
/^sha256:[a-f0-9]{64}$/
enabledToolIds

Tool IDs the user has enabled in tool settings. Omit to allow all tools. The server intersects this with the known toolset and consent gates.

Array<string>
<= 64 items
Example
[
"get_city_costs",
"calculate_fire_number"
]

AI chat response (streamed SSE)

Media typeapplication/json
object
success
required
boolean
data
required
object
conversationId
required

Conversation ID for follow-up messages

string format: uuid
message
required

AI response text

string
Example
{
"success": true
}

Validation error

Media typeapplication/json
object
success
required

Always false for error responses

boolean
error
required

Error type

string
code

Machine-readable error code

string
details

Detailed validation errors

Array<object>
object
path
required

Path to the invalid field

string
message
required

Error message

string
Example
{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{
"path": "currentAge",
"message": "Must be between 18 and 100"
}
]
}

Unauthorized

Media typeapplication/json
object
success
required

Always false for error responses

boolean
error
required

Error type

string
code

Machine-readable error code

string
details

Detailed validation errors

Array<object>
object
path
required

Path to the invalid field

string
message
required

Error message

string
Example
{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{
"path": "currentAge",
"message": "Must be between 18 and 100"
}
]
}

AI rate limit exceeded

Media typeapplication/json
object
success
required

Always false for error responses

boolean
error
required

Error type

string
code

Machine-readable error code

string
details

Detailed validation errors

Array<object>
object
path
required

Path to the invalid field

string
message
required

Error message

string
Example
{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{
"path": "currentAge",
"message": "Must be between 18 and 100"
}
]
}