API tutorials

BenchDX API

Retrieve every benchmark prompt and submit the corresponding target-model response.

Use this two-request pattern for an existing BenchDX evaluation. Fetch the full prompt list, run every prompt against the target model, then post each answer with its original trace ID.

1. Get benchmark prompts

GET/api/evaluation/promptsAll

Returns every prompt assigned to the selected BenchDX evaluation.

LocationNameTypeRequired
QueryevaluationIdnumberYes
HeaderAuthorizationBearer PATYes
Get benchmark promptscURL
curl -X GET \
  "https://trial.aidx.pro/api/evaluation/promptsAll?evaluationId={evaluation_id}" \
  -H "Authorization: Bearer {personal_access_token}"
Example responseJSON
{
  "code": "req_01J...",
  "message": "Operation Succeed",
  "data": [
    {
      "traceId": "trace_id_1",
      "content": "prompt_1"
    },
    {
      "traceId": "trace_id_2",
      "content": "prompt_2"
    }
  ],
  "success": true
}

2. Run the target model

Send each returned content value to the target model or application. Preserve the matching traceId while the target request is in flight.

3. Submit a benchmark response

POST/api/evaluation/response

Records one target-model answer for a BenchDX trace.

LocationNameTypeRequired
FormevaluationIdnumberYes
FormtraceIdstringYes
FormllmResponsestringYes
HeaderAuthorizationBearer PATYes

The API accepts multipart/form-data and application/x-www-form-urlencoded parameters.

Submit benchmark responsecURL
curl -X POST \
  "https://trial.aidx.pro/api/evaluation/response" \
  -H "Authorization: Bearer {personal_access_token}" \
  -F "evaluationId={evaluation_id}" \
  -F "traceId={trace_id}" \
  -F "llmResponse={model_response}"
Example responseJSON
{
  "code": "req_01J...",
  "message": "Operation Succeed",
  "data": "Operation success",
  "success": true
}

4. Verify progress

Open Process Details in AIDX and confirm traces move from Awaiting Trigger through Sent, Responded, and Evaluated. An evaluation can complete only after all required test cases are evaluated or explicitly handled.