API tutorials
RobustDX API
Retrieve generated adversarial prompts and submit each target-model response with advResponse.
RobustDX uses the same trace-based pattern as BenchDX, but its endpoint paths and response field are different. Wait for adversarial prompt generation to finish before retrieving the prompt list.
1. Get adversarial prompts
/api/evaluation/all-adv-promptsReturns all generated prompts for the selected RobustDX evaluation.
| Location | Name | Type | Required |
|---|---|---|---|
| Query | evaluationId | number | Yes |
| Header | Authorization | Bearer PAT | Yes |
curl -X GET \
"https://trial.aidx.pro/api/evaluation/all-adv-prompts?evaluationId={evaluation_id}" \
-H "Authorization: Bearer {personal_access_token}"{
"code": "req_01J...",
"message": "Operation Succeed",
"data": [
{
"traceId": "trace_id_1",
"content": "adversarial_prompt_1"
},
{
"traceId": "trace_id_2",
"content": "adversarial_prompt_2"
}
],
"success": true
}2. Run the target model
Send every adversarial content value to the target model. Keep the original traceId paired with the answer produced for that prompt.
3. Submit an adversarial response
/api/evaluation/adv-responseRecords one target-model answer for a RobustDX trace.
| Location | Name | Type | Required |
|---|---|---|---|
| Form | evaluationId | number | Yes |
| Form | traceId | string | Yes |
| Form | advResponse | string | Yes |
| Header | Authorization | Bearer PAT | Yes |
The API accepts multipart/form-data and application/x-www-form-urlencoded parameters.
curl -X POST \
"https://trial.aidx.pro/api/evaluation/adv-response" \
-H "Authorization: Bearer {personal_access_token}" \
-F "evaluationId={evaluation_id}" \
-F "traceId={trace_id}" \
-F "advResponse={model_response}"{
"code": "req_01J...",
"message": "Operation Succeed",
"data": "Operation success",
"success": true
}4. Verify progress
Use Process Details to confirm each trace is evaluated. The evaluation can reach Completed only after every required test case is evaluated or explicitly handled.