Migration from the Legacy API
Summary
The old public integration docs were based on:
- Header:
X-TOKEN-KEY - Base path:
/api/open/evaluation/*
The current public API uses:
- Header:
X-API-Key - Base path:
/api/keath/public/v1/*
Mapping
| Legacy | Current |
|---|---|
X-TOKEN-KEY | X-API-Key |
POST /api/open/evaluation/start | POST /api/keath/public/v1/evaluations |
GET /api/open/evaluation/result | GET /api/keath/public/v1/evaluations/:taskId |
| legacy queue polling | GET /api/keath/public/v1/evaluations/:taskId/status |
| legacy direct model lookup assumptions | GET /api/keath/public/v1/models |
Mental Model Shift
Legacy evaluation flow:
- Send assignment text and rubrics directly
- Start evaluation
- Poll results
Current public v1 flow:
- Get a
model_idfromGET /models - Create a student assignment with
POST /assignments, or usePOST /evaluations/one-passfor direct model grading - Submit the essay text or answer file to
POST /evaluationswith the returnedassignment_id - Poll
GET /evaluations/:taskId/status - Fetch the final payload from
GET /evaluations/:taskId
Reliable async evaluation
POST /evaluations/one-pass and POST /evaluations/batch use the reliable asynchronous path. They return HTTP 202 Accepted with a public task_id. Send an Idempotency-Key so a safe network retry returns the same task instead of creating a duplicate. A batch request accepts 1-100 items.
These tasks move through QUEUED, UPLOADING, SUBMITTED, and PROGRESS, then finish as SUCCESS, FAILURE, or CANCEL. Credits are charged only after KEATH validates a complete result. Poll with a bounded timeout and backoff; do not use an endless loop.
POST /evaluations for an existing assignment remains on the legacy task path for compatibility. It normally starts as PENDING and charges credits when the task is accepted. Do not assume its billing and initial status are the same as one-pass or batch.
If you need to create a model first, the new build flow is:
- Parse question assets
- Parse rubric assets
- Confirm the preview result
- Create the marking model with
POST /models - Reuse that model to create assignments or one-pass evaluations
Input Differences
The current public API is multimodal for model-building:
- PDFs are supported
- images are supported
- direct file upload is supported
- existing public URLs are supported
specificationhelps disambiguate which question or rubric to use
The current public evaluation endpoint supports text and answer file uploads:
- submit the essay as
paper_content - pass an existing student assignment
assignment_id - optionally pass
current_feedbacks - optionally choose
styleasBullet,Short, orLong
Direct PDF/image, DOCX, TXT, and RTF answer uploads are supported by POST /evaluations.
Client Changes
Update your client to:
- Replace
X-TOKEN-KEYwithX-API-Key - Replace
/api/open/evaluation/*routes with/api/keath/public/v1/* - Treat
model_idas the marking model id fromGET /models - Treat
assignment_idas the student assignment id fromPOST /assignmentsor the product assignment detail URL - For grading, submit essay text or an answer file to
POST /evaluations - Poll
GET /evaluations/:taskId/statuswhile the task is running - Fetch the final result from
GET /evaluations/:taskId - For local PDFs/images used during model creation, send
multipart/form-data - For existing public file URLs, send
assets[] - If mixing uploads and URLs, send multipart plus JSON-stringified
assets - If you use organization-scoped keys, treat them as wider model visibility, not shared billing. Credits still come from the key owner.
Recommended Validation
- Re-run your smoke test against
GET /credits - Re-run your smoke test against
GET /models - Create an assignment with
POST /assignments - Submit one essay to
POST /evaluations - Poll
GET /evaluations/:taskId/status - Fetch the final payload from
GET /evaluations/:taskId - If you still build models via API, send one PDF to
questions-ingest-preview - Send one rubric file to
rubrics-ingest-preview - Confirm no client code still references
X-TOKEN-KEY