How it fits together
The API keeps one record per item, filed under the reference you already use: a SKU, lot number, claim number or listing ID. The three products work on that same record, so you can start with one and add the others without moving data.
- Scan APIStore a case under your own ID, assess it, read the result and your usage.
- IntakeThe review queue: correct, escalate, decide, export, and record what happened.
- VerifyCheck listing claims, set your rule packs and record listing reviews.
Keys and the sandbox
Every request carries a workspace key as a Bearer token. Keys are issued by our team, one workspace per customer, each with the scopes it needs.
| Key | What it does |
|---|---|
gsk_test_… | Sandbox. Every route behaves as in production, but photo assessments run on a stub engine: deterministic output, no cost, never counted against quota. |
gsk_live_… | Production. Assessments run the real engine and count as billable units under your pilot terms. |
Your first assessment
Set the base URL and your key once. Every sample in these docs assumes this setup.
export GEMSTONEAI_BASE="https://api.gemstoneaiapp.com/public/v1"
export GEMSTONEAI_KEY="gsk_test_..." # your sandbox key1. Store a case under your own reference. The title says solid gold, the seller says plated: a conflict the assessment should catch. Sending the same case again changes nothing.
curl -X POST "$GEMSTONEAI_BASE/cases" \
-H "Authorization: Bearer $GEMSTONEAI_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "SKU-1001",
"title": "14k gold diamond ring",
"statement": "Gold plated sterling silver ring with CZ, size 7",
"claims": [{"field": "metal", "value": "14k solid gold", "source_kind": "stated"}]
}'2. Assess it. With text only, the answer comes back at once with 201. Send an Idempotency-Key so a retried request is never run twice.
curl -X POST "$GEMSTONEAI_BASE/case-assessments" \
-H "Authorization: Bearer $GEMSTONEAI_KEY" \
-H "Idempotency-Key: sku-1001-r1" \
-F external_id=SKU-1001{
"id": 81,
"external_id": "SKU-1001",
"revision": 1,
"status": "completed",
"mode": "text_only",
"photo_count": 0,
"rules_version": "commerce-evidence-2",
"result": {
"fields": [
{
"field": "metal",
"value": null,
"standing": "conflict",
"note": "The sources disagree on the metal. Nothing here is promoted to solid gold."
}
],
"conflicts": [
{
"code": "metal_solid_vs_not_solid",
"severity": "high",
"field": "metal"
}
],
"next_evidence": [
{
"field": "metal",
"ask": "Which description is correct, with a photo that shows it."
}
],
"indicative_value": null
},
"sandbox": true,
"outcome": "completed"
}The metal is reported as a conflict with the evidence behind each side, never promoted to the higher claim. With photos the same call answers 202 and you poll it; the Scan API guide walks through that and every field of the result.
Rules every route follows
- Base URL
https://api.gemstoneaiapp.com/public/v1. JSON in and out, except uploads, which aremultipart/form-data. - Every response carries
GemstoneAI-API-Version: 2026-11-23, the date of the contract it was served under. - Your ID is the key. Cases are read, revised and deleted by
external_id; a case from another workspace is a404. - Writes are safe to retry. Re-sending a case with the same content changes nothing; an assessment retried with the same
Idempotency-Keyreturns the first one and is not billed again. - Earlier revisions are kept as they were. A correction adds a revision; it never edits history.
- Timestamps are UTC, ISO 8601. Monthly quotas and unit ledgers run on UTC months.
- A partner request never creates an item in a consumer collection and never uses a person's scan allowance.
Scopes
Each key carries scopes. A route that needs one the key lacks answers 403 and names it.
| Scope | Allows |
|---|---|
cases:read | Read cases, assessments, usage, the review queue, outcomes and the pilot ledger. |
cases:write | Create, revise and delete cases, import batches, record outcomes. |
assessments:write | Run assessments. |
cases:review | Assign, correct, escalate, request evidence and refer. |
cases:approve | Approve, decline, export, and set pilot terms. |
listings:check | Run listing checks and preview reviews. |
listings:review | Record listing reviews and act on their flags. |
listings:escalations | Clear an escalated flag. |
listings:admin | Publish and retire rule packs, read review metrics. |
Errors
Errors come back as JSON with a detail field. Where your code should branch, detail is an object with an error code and a plain-language message.
{
"detail": {
"error": "idempotency_conflict",
"assessment_id": 81,
"message": "This Idempotency-Key was used with a different request. Use a new key for new input."
}
}| Status | Meaning | What to do |
|---|---|---|
401 | Missing, invalid, revoked or suspended key | Check the Authorization header and the key. |
403 | The key lacks a scope the route needs | The message names the missing scope. |
404 | Not found in your workspace | Another workspace's case is also a 404. |
409 idempotency_conflict | The same Idempotency-Key with a different body | Use a new key for new input. |
409 stale | The case moved past the revision you sent | Read current_revision and show the newer version. |
409 (cases) | POST /cases for an existing ID with different content | Send it to /case-revisions. |
413 | A photo over 15 MB, or a CSV over 5 MB | Resize or split. |
422 | Validation failed, or missing_evidence on an assessment | detail says which field. |
429 quota_exhausted | The workspace used its assessments for the month | Retry-After and resets_at say when. Reads and replays still work. |
429 rate_limit_exceeded | Too many requests in the window | Wait retry_after_seconds. |
5xx | Our fault | Retry with the same Idempotency-Key. |
OpenAPI spec
The API reference is generated from the published OpenAPI 3.1 spec. Any OpenAPI generator can build a typed client from it, and Swagger lets you try each route with your sandbox key.
Sandbox key
Request a sandbox key.
Tell us what you are connecting. We issue a gsk_test_ key for your own workspace, with the scopes your product needs.