Grade-as-a-Service API
Embed standardized, AI-powered clothing condition grading into your marketplace, resale app, or internal tooling. Send photos, get a 1.0–10.0 condition grade, a factor-by-factor report, and a verifiable certificate, all through a simple REST API with a JavaScript SDK, a no-credit sandbox, and white-label embeds. Sandbox keys are free on every plan, Free included; live keys come with the Business plan.
Quickstart
- Create an API key. In your dashboard under Account → API keys, create a sandbox key (free on every plan) or a live key (Business plan), and grant only the scopes you need (
submit,read,webhook_manage). The secret is shown once — store it safely. Rotate or revoke it anytime. - Try it free in the sandbox. Call
/api/v1/sandbox/grades(below) — deterministic sample grades, zero credits, same shapes as production. - Go live. Switch to a live key (Business plan), drop the
/sandboxpath, attach real photos (front, back and label are required; a detail close-up is recommended), and submit to/api/v1/grades. Poll/api/v1/grades/:idor receive a webhook. - Scale up. Grade up to 50 garments per call with
/api/v1/grades/batchand let webhooks push each result as it finishes.
Authentication
Every request authenticates with an API key in the X-API-Key header. Keys are created in your dashboard under Account → API keys, are shown once, and can be scoped to read, submit, and webhook_manage. Rotate or revoke a key at any time. A sandbox key starts with gt_test_, is free on every plan, and works on /api/v1/sandbox/* and in test mode (below); anywhere else it gets 403 SANDBOX_ONLY_KEY. A live key reaches every endpoint and comes with the Business plan. Base URL: https://functions.gradethread.com.
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
| POST | /api/v1/grades | submit | Submit a garment (photos) for grading. |
| POST | /api/v1/grades/batch | submit | Submit up to 50 garments as one durable async batch. |
| GET | /api/v1/grades/batch/:id | read | Poll a batch's status + per-garment results. |
| GET | /api/v1/grades/:id | read | Fetch a submission and its grade report. |
| DELETE | /api/v1/grades/:id | submit | Delete a grade: removes its photos, takes the certificate down and clears its text. Billing records stay. 409 while it is still grading. |
| GET | /api/v1/grades | read | List grades, paginated. |
| GET | /api/v1/retention | read | Read the account's grade retention period. null means none is set. |
| PUT | /api/v1/retention | submit | Set how many days grades are kept (1 to 3650), or null to keep them. Older grades are deleted nightly. |
| GET | /api/v1/usage | read | This key's monthly call usage vs quota + reset date, and the account's calls per day. |
| GET | /api/v1/referrals | read | Referral partners. Sellers who signed up through your signed links, newest first, with signup, first grade and first paid dates. |
| GET | /api/v1/items | read | List inventory items, paginated and filterable by status. |
| GET | /api/v1/items/:id | read | Fetch one inventory item and its attributes. |
| GET | /api/v1/listings | read | List marketplace listings, paginated. |
| GET | /api/v1/sales | read | List completed sales, paginated. |
| GET | /api/v1/analytics | read | List the FlipDesk Analytics views and the parameters each one takes. |
| GET | /api/v1/analytics/:view | read | One Analytics view (sell-through, price curve, returns and the rest), the same numbers the page shows. Cohort figures keep the same privacy floor. |
| POST | /api/v1/seals | submit | Seal a garment's condition at shipping: photos plus an order reference, or a certificate you graded. |
| GET | /api/v1/seals | read | List your seals, newest first, filterable by order reference. |
| GET | /api/v1/seals/:id | read | One seal with signed photo URLs and every comparison run on it. |
| POST | /api/v1/seals/:id/compare | submit | Compare return photos with the seal. The verdict is advisory, never a fraud finding. |
| POST | /api/v1/routing-profiles | submit | Create a returns routing profile: the minimum grade for restock, outlet and resale, with per-category overrides. |
| GET | /api/v1/routing-profiles | read | List your routing profiles. |
| GET | /api/v1/routing-profiles/:id | read | One routing profile. |
| PATCH | /api/v1/routing-profiles/:id | submit | Change a routing profile. Batches already sent keep the copy they were routed by. |
| DELETE | /api/v1/routing-profiles/:id | submit | Delete a routing profile. |
| PUT | /api/v1/trade-in/offer-table | submit | Pilot. Set your buy-back offer table: credit per grade band, with per-category lists. |
| GET | /api/v1/trade-in/offer-table | read | Pilot. Read your offer table. |
| POST | /api/v1/trade-in/quotes | submit | Pilot. Grade a customer's at-home photos and quote from your offer table. Low confidence returns a range. |
| GET | /api/v1/trade-in/quotes/:id | read | Pilot. One quote, with its intake grade once attached. |
| POST | /api/v1/trade-in/quotes/:id/intake | submit | Pilot. Attach the grade the garment got at intake, to compare with the quote. |
| GET | /api/v1/trade-in/agreement | read | Pilot. How often at-home quotes agree with intake, with the sample size. |
| POST | /api/v1/brands/:accountId/passports | submit | Brand partners. Mint Garment Passports and printable tags for up to 500 items, keyed on your own item id. A retry returns the same passports. |
| GET | /api/v1/brands/:accountId/passports | read | Brand partners. How many passports you minted and how many were since claimed, graded and sold. No later owner is named. |
| PATCH | /api/v1/webhook | webhook_manage | Set the URL we POST to when a grade completes. The first call returns your signing secret. |
| GET | /api/v1/webhook | webhook_manage | Read your webhook URL and whether it has a signing secret. |
| POST | /api/v1/webhook/secret/rotate | webhook_manage | Get a new signing secret. Shown once. |
| GET | /api/v1/webhook/deliveries | webhook_manage | Recent deliveries: status, attempts and the last response code. |
| POST | /api/v1/webhook/deliveries/:id/redeliver | webhook_manage | Send one event again, with the same webhook-id. |
| GET | /api/v1/events | webhook_manage | Every event sent to your account, oldest first, by cursor. Use it to catch up after an outage. |
| POST | /api/v1/sandbox/grades | submit | Free mock submit — returns a sample grade, no credits. |
| GET | /api/v1/sandbox/grades/:id | read | Free mock fetch — returns a sample grade. |
| GET | /api/v1/price-guide | read | List published Resale Condition Index items (the catalog). |
| GET | /api/v1/price-guide/:slug | read | Resale value range + sell-through by grade band for an item. |
| GET | /api/v1/sandbox/price-guide | read | Free mock catalog — the sandbox mirror of the list endpoint. |
| GET | /api/v1/sandbox/price-guide/:slug | read | Free mock price guide — deterministic sample, no live data. |
All responses share one envelope: { data, error, meta }. A failed call has error: { message, code, details }. Switch on code, not on the message: UNAUTHORIZED, INSUFFICIENT_SCOPE, SANDBOX_ONLY_KEY, RATE_LIMITED, QUOTA_EXCEEDED, VALIDATION_FAILED, NOT_FOUND or INTERNAL, or a more specific one a call documents. Every response carries meta.request_id, the same as the X-Request-Id header; quote it to support.
Full machine-readable reference (OpenAPI 3.1) — openapi.json. No key required; import it into Postman, Insomnia, or your codegen of choice.
Batch grading
Grade up to 50 garments in one call. The batch is durable and async: you get a batch id back immediately, each garment is graded and charged independently (partial success is fine), and a grade.completed webhook fires per garment. Poll the batch-status endpoint for per-garment results. Every garment is validated the same way as a single grade — an invalid garment rejects the whole request up front. Prefer image URLs over base64 in a batch.
curl https://functions.gradethread.com/api/v1/grades/batch \
-X POST \
-H "X-API-Key: gt_sk_..." \
-H "Content-Type: application/json" \
-d '{"garments":[
{"title":"Denim jacket","garment_type":"outerwear","garment_category":"jacket",
"images":[{"image_type":"front","url":"https://.../f.jpg"},
{"image_type":"back","url":"https://.../b.jpg"},
{"image_type":"label","url":"https://.../l.jpg"},
{"image_type":"detail","url":"https://.../d.jpg"}]}
]}'
# → 202 { "data": { "id": "<batch_id>", "status": "running", "item_count": 1 } }
# Poll GET /api/v1/grades/batch/<batch_id> for per-garment results.Webhooks
Set a webhook URL with PATCH /api/v1/webhook. There is one webhook per account, so each grade sends one grade.completed event however many API keys you have. The first time you set a URL, the response includes a signing_secret that starts with whsec_. Save it: we show it once. Need a new one? Call POST /api/v1/webhook/secret/rotate.
Three events arrive there. grade.completed when a grade is final, grade.failed when a garment could not be graded (any charge was reversed), and batch.completed once every garment in a batch is done, with each one's outcome. Each is sent once, so you never need to poll for a result.
Deliveries follow the Standard Webhooks format, so their verification libraries work as-is. To check one by hand, take the base64 part of your secret after whsec_, decode it, and compute an HMAC-SHA256 over {webhook-id}.{webhook-timestamp}.{raw body}. Base64 it and compare with the value after v1, in webhook-signature. Reject a timestamp more than five minutes old, and use webhook-id to ignore repeats. A failed delivery is retried for about 12 hours, and GET /api/v1/webhook/deliveries shows every attempt.
POST <your webhook_url>
webhook-id: 6f1c… (same on every retry of this event)
webhook-timestamp: 1757000000
webhook-signature: v1,<base64 HMAC-SHA256 of "{id}.{timestamp}.{raw body}">
{
"id": "6f1c…",
"event": "grade.completed",
"data": {
"submission_id": "…",
"grade_report": { "id": "…", "overall_score": 8.5,
"grade_tier": "Excellent", "certificate_id": "…",
"finalized_at": "2026-07-09T…Z" }
},
"timestamp": "2026-07-09T…Z"
}Sandbox (no credits)
Build and test your integration with zero credits. The sandbox endpoints return deterministic sample grades, with the same auth, scopes and response shape as production, so the only thing you change to go live is the URL path and the key. Sandbox keys are free on every plan, Free included, and sandbox calls never spend credits or count toward a quota. Going live needs a live key, which comes with the Business plan.
curl https://functions.gradethread.com/api/v1/sandbox/grades \
-X POST \
-H "X-API-Key: gt_sk_..." \
-H "Content-Type: application/json" \
-d '{"title":"Vintage denim jacket","brand":"Levi'\''s"}'Test mode (certify your integration)
Call the live endpoints with a gt_test_ sandbox key and you get the live flow back: POST /api/v1/grades and POST /api/v1/grades/batch answer 202, the grade moves from queued to processing to a final state over a few seconds, GET /api/v1/grades/:id and GET /api/v1/grades/batch/:id show each step, and your webhook endpoint gets signed grade.completed, grade.failed and batch.completed events with "livemode": false. The grader is a deterministic fake: no AI call, no charge, no quota, and nothing reaches your live grades, your live event log or a public certificate. Test ids start with tgr_ and tbt_; GET /api/v1/events with a test key lists test events only.
Force an outcome by putting a magic word in the title, description or external_id:
gt_test_failed: the grade fails and sendsgrade.failed.gt_test_review: the grade waits inpending_reviewfor about a minute, then completes withneeds_human_review: true.gt_test_slow: grading takes about two minutes instead of three seconds.
A poll returns the state, the garment type, category and grade; title, brand, description and your partner ids come back on the 202 and in the webhook, not on a poll. GET /api/v1/grades lists nothing in test mode.
Verify a certificate (no key)
Anyone can check a GradeThread certificate, with no API key and from any origin (the two reads send Access-Control-Allow-Origin: *). Look up the number printed on a hangtag, then confirm the grade still matches the hash sealed when it was issued.
# 1. A printed number to a certificate
curl https://functions.gradethread.com/api/content/public/certificates/by-number/GT-XXXXXXX
# {"found":true,"certificate_id":"...","certificate_number":"GT-XXXXXXX","overall_score":9.2,...}
# 2. Has the grade changed since it was issued?
curl https://functions.gradethread.com/api/content/public/certificates/<certificate_id>/verify
# {"verified":true,"status":"verified","algorithm":"...",...}verified: true means the grade has not changed since it was issued. To send a person straight to a certificate, link https://gradethread.com/verify?code=GT-XXXXXXX or https://gradethread.com/cert/GT-XXXXXXX; both redirect. Both endpoints are in the OpenAPI spec under “Certificates (no key)”.
Resale Condition Index price guide
Beyond grading, the API exposes GradeThread's proprietary Resale Condition Index as a queryable price guide: for a published brand-and-category item, the resale value range and sell-through at each condition-grade band. It's read-scoped and rate-limited like every other endpoint, with a no-credit sandbox. Every figure is aggregate-only and sample-gated — items and bands without enough recent data are not returned rather than guessed.
curl https://functions.gradethread.com/api/v1/price-guide/patagonia-better-sweater \
-H "X-API-Key: gt_sk_..."
# → { "data": { "slug": "patagonia-better-sweater", "brand": "Patagonia",
# "bands": [ { "band": "high", "gradeRange": "8.5 – 10.0",
# "valueLowCents": 6500, "valueMedianCents": 8200,
# "valueHighCents": 9800, "sellThrough": 0.78 }, ... ] } }JavaScript SDK
A zero-dependency, typed client for Node 20+ and the browser. It sends an Idempotency-Key on every grade submission and retries rate limits and outages without charging twice.
Install it from npm:
npm install @gradethread/sdkThen:
import { GradeThread } from "@gradethread/sdk";
const gt = new GradeThread({ apiKey: process.env.GRADETHREAD_API_KEY });
// Try it free in the sandbox (no credits spent):
const sample = await gt.sandbox.grades.create({ title: "Vintage denim jacket" });
console.log(sample.grade_report.overall_score); // e.g. 8.5
// Live grading:
const job = await gt.grades.create({
title: "Vintage denim jacket",
garment_type: "outerwear",
garment_category: "jacket",
images: [
{ image_type: "front", url: "https://.../front.jpg" },
{ image_type: "back", url: "https://.../back.jpg" },
{ image_type: "label", url: "https://.../label.jpg" },
{ image_type: "detail", url: "https://.../detail.jpg" },
],
});
const result = await gt.grades.get(job.id);Rate limits & quotas
Limits are enforced per API key in a 60-second sliding window, with separate budgets for reads (GET) and writes (POST/PATCH). Exceeding a budget returns 429 with a retry_after_seconds hint. Live usage is shown on your dashboard.
| Plan | Reads / min | Writes / min |
|---|---|---|
| Business (live and sandbox keys) | 240 | 40 |
| Pro (sandbox keys) | 120 | 20 |
| Starter (sandbox keys) | 60 | 10 |
| Free (sandbox keys) | 30 | 5 |
Grading volume is metered by credits: each live grade spends 1 credit (Standard), 3 (Premium), or 5 (Collector, tier key express). Sandbox calls never spend credits.
Calls are metered too. Each Business key includes 10,000 successful API calls a month (sandbox calls are free), reset on the 1st (UTC); GET /api/v1/usage shows where you are. Past that, each call draws one prepaid overage credit: $10 for 2,500 calls, $50 for 14,000, $100 for 30,000, $200 for 65,000. Overage credits never expire and are bought on the API keys page. With none left, calls get 429 QUOTA_EXCEEDED until the month resets.
Compatibility & deprecation
Within /api/v1 we only add things: new endpoints, new optional parameters, new response fields and new enum values. Write your client to ignore fields it does not know, and it keeps working.
Before we remove or change anything, the affected responses carry a Deprecation header and a Sunset header with the date it stops working, at least 90 days ahead. Log those headers and you will hear about a change before it reaches you. A change that cannot be made that way ships as /api/v2, and v1 keeps running beside it.
Every call in the OpenAPI spec has a stable operationId, so a generated client keeps its method names from one release to the next.
One change was made before this policy: on November 4, 2026 the 401 and the monthly-quota 429 moved into the envelope (they had been a bare { error }), and quota_exceeded became QUOTA_EXCEEDED. The message text did not change.
White-label embeds
Render any grade certificate inside your own platform, under your brand. Set your company name, color, and logo in the dashboard and copy the generated <iframe> snippet — buyers see the grade in your brand with a small "Verified by GradeThread" trust mark.
Claude and ChatGPT connector
Connect GradeThread to Claude and run your pipeline from a conversation: ask what is unlisted, get drafts written, publish, reprice, end listings. It is a Model Context Protocol server, so it works in Claude Code, the Claude desktop and web apps, and anything else that speaks MCP.
Included on Pro ($59/mo) and Business ($99/mo). Pro includes 500 connector actions a month and Business 2,000; reading costs nothing and is not counted. The sandbox tools work on every plan, including Free, so you can see what it does before paying for it.
Adding it
In Claude Code:
claude mcp add --transport http gradethread https://functions.gradethread.com/mcpIn the Claude web or desktop app: Settings → Connectors → Add custom connector, then paste https://functions.gradethread.com/mcp. Either way you will be sent to GradeThread to sign in and choose what to allow.
In ChatGPT: Plugins → + → Add custom MCP server, choose a public endpoint, paste the same address and pick OAuth. You sign in on GradeThread and see the same permissions, the same confirmation before anything goes live, and the same monthly action count; Claude and ChatGPT share it. Step-by-step guides, once you are signed in: Claude and ChatGPT.
What you are asked to allow
| Scope | What it lets the assistant do |
|---|---|
read | See inventory, grades, listings and sales. Cannot change anything. |
submit | Grade items, write and edit drafts, publish, reprice and end listings. This is the one that spends money. |
webhook_manage | Set or remove your webhook, rotate its signing secret, and read its delivery log. |
You can turn any of these off on the consent screen and still connect. A read-only connection is a normal thing to want.
Common requests
| Tool | Ask for it like this | What it does | What it will not do |
|---|---|---|---|
gradethread_list_items | “What is still unlisted from last week?” | Lists inventory with filters for brand, category, status and date. | Change anything. Read-only. |
gradethread_grading_readiness | “Why can I not grade the Carhartt jacket yet?” | Names the missing photos and fields per item, the cost, and whether your credits cover the batch. | Submit anything or spend a credit. |
gradethread_grade_item / _batch | “Send these six for grading.” | Previews the exact items and cost, then submits once you confirm. Uses your grading credits. | Grade anything on the first call. Preview always comes first, and the token it returns expires in ten minutes. |
gradethread_create_draft | “Write listings for everything I graded today.” | Generates title, description, category, item specifics and a suggested price from the item's photos. | Publish. It writes a draft and tells you when the batch is done. |
gradethread_update_draft | “Shorten that title and set it to $48.” | Edits title, description, price, quantity, condition and item specifics on an unpublished draft. | Touch a listing that is already live. It refuses those and points at the reprice tool. |
gradethread_publish_listing | “Put the denim jacket live.” | Shows exactly what buyers will see, what eBay takes, and anything blocking it — then publishes on a second, confirmed call. | Publish in one call, publish at a price that changed after you agreed, or tell you it worked when eBay did not confirm it. |
gradethread_reprice_preview / _apply | “What should the Levi’s be priced at?” | Prices from comparable listings and shows before-and-after per listing before changing anything. | Move a price more than 25%, or below an item's cost floor — even if you confirm it. Do those in FlipDesk, looking at the listing. |
gradethread_end_listing / _listings | “Pull everything from that thrift haul.” | Lists every affected item BY NAME, then ends them once confirmed, and reports which actually came down. | Act on a count alone, or claim a listing ended when the marketplace has not taken it down yet. |
gradethread_queue_extension_work | “List these twelve on Poshmark and Mercari.” | Queues the work for your own browser, naming every item and channel first. It runs the next time you open your browser with the GradeThread extension installed — Poshmark, Mercari, Grailed, Vinted and Facebook have no listing API, so nothing else can do it for you. | Put anything live by itself. The work waits for your desktop, and the confirmation says so rather than reporting a listing that does not exist yet. |
gradethread_extension_queue | “What is my browser still waiting to do?” | Shows what is queued, running and needing attention, including work that expired before a browser ever picked it up. | Change anything. Read-only. |
gradethread_comps / _price_guide | “What do these usually sell for?” | Returns comparable listings and the published Resale Condition Index bands. | Change anything. Read-only. |
Every tool (30)
| Tool | What it is for | Changes anything? | Plans |
|---|---|---|---|
gradethread_apply_price_suggestion | Take one price suggestion | Yes (see Connector safety below) | Pro and Business |
gradethread_comps | What has this actually sold for | No, it only reads | Pro and Business |
gradethread_create_draft | Generate draft listings for items | Yes (see Connector safety below) | Pro and Business |
gradethread_dismiss_price_suggestion | Dismiss one price suggestion | Yes (see Connector safety below) | Pro and Business |
gradethread_end_listing | End one live listing | Yes (see Connector safety below) | Pro and Business |
gradethread_end_listings | End several live listings | Yes (see Connector safety below) | Pro and Business |
gradethread_extension_queue | See what the seller's browser still has to do | No, it only reads | Pro and Business |
gradethread_get_batch | Check a grading batch | No, it only reads | Pro and Business |
gradethread_get_grade | Get a grade report | No, it only reads | Pro and Business |
gradethread_get_item | Get one inventory item | No, it only reads | Pro and Business |
gradethread_grade_batch | Submit several items for grading | Yes (see Connector safety below) | Pro and Business |
gradethread_grade_item | Submit one item for grading | Yes (see Connector safety below) | Pro and Business |
gradethread_grading_readiness | Check whether items can be graded | No, it only reads | Pro and Business |
gradethread_list_grades | List grading submissions | No, it only reads | Pro and Business |
gradethread_list_items | List inventory items | No, it only reads | Pro and Business |
gradethread_list_listings | List marketplace listings | No, it only reads | Pro and Business |
gradethread_list_sales | List completed sales | No, it only reads | Pro and Business |
gradethread_price_guide | Look up the GradeThread price guide | No, it only reads | Pro and Business |
gradethread_price_suggestions | Price suggestions waiting for a decision | No, it only reads | Pro and Business |
gradethread_publish_listing | Publish a listing to eBay | Yes (see Connector safety below) | Pro and Business |
gradethread_queue_extension_work | Queue cross-listing work for the seller's browser | Yes (see Connector safety below) | Pro and Business |
gradethread_relist | Relist a sold-out listing | Yes (see Connector safety below) | Pro and Business |
gradethread_reprice_apply | Apply new prices to live listings | Yes (see Connector safety below) | Pro and Business |
gradethread_reprice_preview | See what a reprice would do | No, it only reads | Pro and Business |
gradethread_sandbox_grade | Try grading on sample data | No, it only reads | Every plan |
gradethread_sandbox_price_guide | Try the price guide on sample data | No, it only reads | Every plan |
gradethread_sandbox_publish | Preview a publish on sample data | No, it only reads | Every plan |
gradethread_update_draft | Edit an unpublished draft listing | Yes (see Connector safety below) | Pro and Business |
gradethread_usage | Check API usage and remaining quota | No, it only reads | Pro and Business |
gradethread_verify_certificate | Verify a GradeThread certificate | No, it only reads | Every plan |
Connector safety
Nothing that costs money or reaches a marketplace happens on one call. Grading, publishing, repricing, ending and relisting all preview first and then need a confirmation that is tied to the exact items and prices you were shown. If the price moves between the preview and the confirmation, the confirmation stops being valid and Claude has to show you the new one.
On Claude clients that support it, you are also asked directly: a prompt with a yes-or-no, not a message from Claude saying it asked you.
What it can spend. Grading uses your grading credits. Writing drafts uses one AI action per item. Publishing and repricing cost nothing themselves, but they change what buyers pay. Everything else is free to run.
The caps, which apply even when you confirm. Per hour: 20 publishes, 50 price changes, 20 listings ended. Per day: 200 grades. Per month: your plan's connector actions. And a price move over 25%, or below an item's cost basis, is refused outright. A confirmation is not a safety net for an arithmetic error.
Turning it off. Settings → API keys lists every connected application. Disconnecting one stops it immediately, not at the end of an hour, and not at the end of a session.
Every call is recorded. Each tool call is written to an audit log with the tool, the items it touched, whether it succeeded and why it was refused if it was. It is kept for 400 days. Ask support for your account's log if you ever need to reconstruct what happened.
Pricing
Sandbox keys are free on every plan. Live API access, white-label embeds, and the developer dashboard are included in the Business plan ($99/mo). Grading is billed per grade via credits on top — see the pricing page for credit packs and per-grade tiers.
Build with the grading standard
Build against the sandbox with a free key on any plan, then ship standardized condition grading with a Business live key.
Start Grading FreeEvery endpoint, parameter, error code and webhook payload: the OpenAPI reference.