What you’ll do
Submit an image (generated by any tool, not just a Runflow run) for quality evaluation, then read back a pass verdict, a0.0-1.0 score, and the specific issues found. See Evaluations for the concepts behind this flow.
Prerequisites
- A Runflow API key with the
evaluations:createandevaluations:readscopes (create to submit, read to poll the result). Create one. - An image to evaluate, reachable as an HTTPS URL, a
runflow://assets/{uuid}reference, or adata:URI. - Enough credit balance to cover one evaluation (submission pre-flights the balance).
Steps
Check the price (optional)
Job classes carry per-class prices. Read them at runtime instead of hardcoding:Today
standard is the only active class. The price is frozen onto your evaluation at submission.Submit the image
POST /v1/evaluations. Only generated_image_url and task_type are required; generation_prompt is optional but improves prompt-adherence judging.202 Accepted with a pending evaluation. Keep the id.id is a UUID. Send the Idempotency-Key header so a retried submit does not create (and bill) a second evaluation.Wait for the verdict
Evaluation is asynchronous and usually takes tens of seconds. Choose one:
- Poll
- Callback
Fetch the evaluation until
status_code is terminal (completed or failed). Replace {id} with the id from the previous step.Read the result
On a
completed evaluation, read the verdict:weighted_pass_rate is a number (0.0-1.0); cost is a decimal string of credits charged; top_issues is a list of short labels. Use overall_passed for a yes/no gate and weighted_pass_rate for a threshold. For the per-judge breakdown (each issue with its category / subcategory / detail), request embeds: GET /v1/evaluations/{id}?embed=judges,action,gate_failures.Verify it worked
status_code is completed and overall_passed / weighted_pass_rate are populated. You’re done.Add reference images
For identity or garment checks, attach up to 4 reference images. Each accepts the same three URL forms asgenerated_image_url.
runflow://assets/{uuid} reference. See Upload large files.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
402 on submit | Balance below the job-class price | Top up, then resubmit. |
422 on submit | Bad body | Check task_type is set, text is under length caps, <= 4 reference images, and media URLs are https:// (not http://). |
429 on submit | Too many in-flight evaluations | Wait for some to finish, then retry. |
403 on submit | Key lacks evaluations:create | Recreate the key with the scope. |
Terminal failed | See failure_code | invalid_media means a URL could not be fetched; only processing_failed and completed are billed. |
Related
Evaluations concept
Lifecycle, scoring, job classes, billing.
Handle async callbacks
Receive terminal evaluations by POST.
Upload large files
The runflow:// reference flow for local images.
API reference
POST /v1/evaluations and friends.