Builder Chat
POST/v2/auto/chat
Ask the AI to help you build an EQL query.
The response message contains the AI's reply in Markdown. When it generates EQL, it will be in a JSON code block that you can extract, validate, and submit.
Use sessionId in follow-up requests to maintain conversation context.
Cost
API mode: 1 + dynamic credits
- base request charge:
1credit - dynamic usage charge:
ceil(request_cost * 750)credits
In x402 mode, equivalent reference pricing remains:
fast:5 credits($0.045)expert:18 credits($0.162)
Auth
Required header:
x-elfa-api-key: <api_key>
This route does not require HMAC. Chat produces drafts only; any
subsequent activation goes through POST /queries/drafts/{draftId}/convert,
which gates trade-flavoured drafts behind HMAC.
Request Example
{
"message": "Alert me when BTC breaks 100k",
"speed": "expert",
"sessionId": "optional-session-id"
}
Response Example (200)
{
"sessionId": "session-uuid",
"response": "I can help with that...",
"title": "BTC Breakout Alert",
"reasoning": null,
"planIds": []
}
Best practice: persist
sessionIdand reuse it for follow-up prompts so the model keeps context across turns.
Request
Responses
- 200
- 400
- 401
- 403
Ok
Invalid request
Missing or invalid authentication
Auto is not enabled for this API key