POST /api/v202606/edx/ai/generate

Generates a KQL query from a natural-language question.

GenerateV202606
The prompt is answered only from the EDX-queryable schema; a question that cannot be expressed against those tables returns with success = false and a reason in the error field rather than an HTTP error. The returned KQL is validated by the engine, so the valid field indicates whether it is safe to run as-is, and attempts reports how many generate/validate passes were needed.

Request Headers

Header Value Required Description
ECI-ApiKey string Yes Your API key. See Authentication.
Content-Type application/json Yes All requests must specify JSON content type, including the request body.

Request Body

EdxAiGenerateRequestV202606
Property Description Type
prompt string
Example Request Body application/json
{  "prompt": "string"
}

Responses

200 Generation completed. Inspect `success` and `valid` to determine whether usable KQL was produced. The request succeeded and the response body contains the requested data.

Response Body Parameters

EdxAiGenerateResponseV202606
Property Description Type
attempts integer (int32)
error string
errors string[]
explanation string
kql string
success boolean
valid boolean
Example Response application/json
{  "attempts": 1,  "error": "string",  "errors": [
    "string"
  ],  "explanation": "string",  "kql": "string",  "success": false,  "valid": false
}