{"openapi":"3.1.0","info":{"title":"Mintachu API","version":"1.0.0","summary":"Grade Pokémon card photos, read saved grades and look cards up, on your own Mintachu plan.","description":"Grades are AI estimates from photos, not PSA grades. A grade spends the same daily quota as grading on mintachu.com. Responses carry no prices, comps or eBay data. Every error has the shape {\"error\":{\"code\",\"message\"}}. Use of the API is covered by the API Terms at https://www.mintachu.com/developers/terms.","termsOfService":"https://www.mintachu.com/developers/terms"},"servers":[{"url":"https://www.mintachu.com"}],"externalDocs":{"description":"Developer guide","url":"https://www.mintachu.com/developers"},"security":[{"apiKey":[]}],"tags":[{"name":"Account"},{"name":"Grades"},{"name":"Cards"},{"name":"MCP"}],"paths":{"/api/v1/me":{"get":{"operationId":"me","x-mcp-tool":["get_account"],"x-scope":"any","tags":["Account"],"summary":"Your plan, API access and what is left of each quota","responses":{"200":{"description":"The account behind the key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/grades":{"get":{"operationId":"listGrades","x-mcp-tool":["list_grades"],"x-scope":"grades:read","tags":["Grades"],"summary":"Saved grades, from the web and the API alike, newest first","parameters":[{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"q","in":"query","description":"Filter by card name, set or number.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of saved grades.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradeList"}}}},"400":{"description":"Bad offset, limit or q.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createGrade","x-mcp-tool":["grade_card"],"x-scope":"grades:write","tags":["Grades"],"summary":"Grade a card from photos (spends one grade of the mode's daily quota)","description":"At most 4 photos: front, back and close-ups. Each is an https:// URL (port 443, public hosts only) or a base64 data URL; JPEG, PNG or WebP up to 8 MB. Requests are limited to about 4 MB, so send large photos as URLs. Photos are checked before any quota is spent. At most 2 grades run at once per account. Answers 202 at once; read the grade with GET /api/v1/grades/{id}?wait=25.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradeRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/GradeRequestMultipart"}}}},"responses":{"202":{"description":"The grade is running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradeStarted"}}},"headers":{"Location":{"schema":{"type":"string"}},"X-Mintachu-Quota-Mode":{"schema":{"type":"string"}},"X-Mintachu-Quota-Remaining":{"description":"A number, or \"unlimited\".","schema":{"type":"string"}},"X-Mintachu-Quota-Reset":{"schema":{"type":"string","format":"date-time"}}}},"400":{"description":"A bad photo (invalid_image) or field (invalid_request). Nothing was spent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"As above, or the plan doesn't include the mode (mode_not_allowed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (rate_limited, also when 2 grades are already running) or the mode's quota is used up (quota_exhausted, with resetAt).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/grades/{id}":{"get":{"operationId":"getGrade","x-mcp-tool":["grade_card","get_grade"],"x-scope":"grades:read","tags":["Grades"],"summary":"One grade: status and, once done, the report","parameters":[{"name":"id","in":"path","required":true,"description":"The id POST /grades returned (readable for 30 minutes), or a saved grade's historyId (readable until deleted).","schema":{"type":"string"}},{"name":"wait","in":"query","description":"Hold the request until the grade finishes or this many seconds pass.","schema":{"type":"number","minimum":0,"maximum":25}}],"responses":{"200":{"description":"The grade.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Grade"}}}},"400":{"description":"Bad wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such grade on this account (not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteGrade","x-scope":"grades:write","tags":["Grades"],"summary":"Delete a grade from History, by either id","parameters":[{"name":"id","in":"path","required":true,"description":"The id POST /grades returned (readable for 30 minutes), or a saved grade's historyId (readable until deleted).","schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","required":["id","object","deleted"],"properties":{"id":{"type":"string"},"object":{"const":"grade"},"deleted":{"const":true}}}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such grade on this account (not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The grade is still running (grade_running).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cards":{"get":{"operationId":"findCards","x-mcp-tool":["find_card"],"x-scope":"cards:read","tags":["Cards"],"summary":"Find cards by name, set and number; spends no quota","description":"Give q, set or both. Cards come newest set first, with sets whose name matches q. No prices.","parameters":[{"name":"q","in":"query","description":"Part of a card's name, as plain text.","schema":{"type":"string","minLength":2,"maxLength":60}},{"name":"set","in":"query","description":"A set id, e.g. base1.","schema":{"type":"string"}},{"name":"number","in":"query","description":"A card number within its set.","schema":{"type":"string"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Matching cards.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardList"}}}},"400":{"description":"Bad search (invalid_request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cards/{id}":{"get":{"operationId":"getCard","x-mcp-tool":["get_card"],"x-scope":"cards:read","tags":["Cards"],"summary":"One card by id, such as base1-4; spends no quota","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","examples":["base1-4"]}}],"responses":{"200":{"description":"The card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such card (not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/mcp":{"post":{"operationId":"mcp","x-scope":"any","tags":["MCP"],"summary":"The MCP server (Streamable HTTP, stateless JSON)","description":"One JSON-RPC 2.0 message per request, answered with JSON. Tools: get_account, grade_card, get_grade, list_grades, find_card, get_card. Each tool runs the REST operations named in their x-mcp-tool, with the same key, scopes and quotas.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"]}}}},"responses":{"200":{"description":"A JSON-RPC response.","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"A notification was accepted."},"401":{"description":"No API key, or a key that is invalid, expired or revoked (missing_api_key, invalid_api_key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (insufficient_scope), or the account has no API access now (api_access_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over 60 requests a minute for this key (rate_limited, with Retry-After).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"A store or the catalog is unavailable; retry (unavailable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from mintachu.com/account/developer: Authorization: Bearer ak_…"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"additionalProperties":true}}},"Quota":{"type":"object","properties":{"allowed":{"type":"boolean"},"remaining":{"type":["integer","null"]},"limit":{"type":["integer","null"]},"period":{"type":"string"},"resetAt":{"type":["string","null"],"format":"date-time"}}},"Account":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"plan":{"type":"object","properties":{"tier":{"type":"string"},"label":{"type":"string"},"source":{"type":"string"}}},"admin":{"type":"boolean"},"betaMember":{"type":"boolean"}}},"apiAccess":{"type":"object","properties":{"allowed":{"type":"boolean"},"reason":{"type":["string","null"]},"rollout":{"type":"string"}}},"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}},"quota":{"type":"object","properties":{"modes":{"type":"object","description":"One Quota per grading mode.","additionalProperties":{"$ref":"#/components/schemas/Quota"}},"customAnalysis":{"$ref":"#/components/schemas/Quota"}}}}},"GradeRequest":{"type":"object","required":["front"],"properties":{"mode":{"type":"string","enum":["quick","balanced","detailed","agent"],"default":"quick"},"front":{"type":"string","description":"https:// URL or base64 data URL."},"back":{"type":"string"},"extra":{"type":"array","items":{"type":"string"},"maxItems":2},"cardHint":{"type":"string","maxLength":160}}},"GradeRequestMultipart":{"type":"object","required":["front"],"properties":{"mode":{"type":"string","enum":["quick","balanced","detailed","agent"]},"front":{"type":"string","format":"binary"},"back":{"type":"string","format":"binary"},"extra":{"type":"array","items":{"type":"string","format":"binary"}},"cardHint":{"type":"string"}}},"GradeStarted":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"grade"},"status":{"const":"running"},"mode":{"type":"string","enum":["quick","balanced","detailed","agent"]},"createdAt":{"type":"string","format":"date-time"},"imageCount":{"type":"integer"},"links":{"type":"object","properties":{"self":{"type":"string"}}}}},"Report":{"type":"object","properties":{"schemaVersion":{"const":1},"card":{"type":"object","properties":{"identified":{"type":"boolean"},"name":{"type":["string","null"]},"baseName":{"type":["string","null"]},"set":{"type":["string","null"]},"number":{"type":["string","null"]},"language":{"type":["string","null"]},"variant":{"type":["string","null"]},"firstEdition":{"type":["boolean","null"]},"shadowless":{"type":["boolean","null"]}}},"grade":{"type":"object","properties":{"scale":{"const":"PSA"},"estimate":{"type":["number","null"]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"confidence":{},"rawCondition":{"type":["string","null"]},"reasoning":{"type":["string","null"]}}},"subgrades":{"type":"object","description":"Each as the grader wrote it: a short note in quick mode, a scored assessment in deeper modes.","properties":{"centering":{},"corners":{},"edges":{},"surface":{}}},"defects":{"type":"array","items":{"type":"string"}},"imageQuality":{}}},"Grade":{"type":"object","required":["id","object","status"],"properties":{"id":{"type":"string"},"object":{"const":"grade"},"status":{"type":"string","enum":["running","done","failed","cancelled"]},"mode":{"type":["string","null"],"enum":["quick","balanced","detailed","agent",null]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"historyId":{"type":["string","null"]},"historyError":{"type":["string","null"]},"corrected":{"type":"boolean","description":"Present on a saved grade read by its historyId."},"report":{"oneOf":[{"$ref":"#/components/schemas/Report"},{"type":"null"}]},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"GradeSummary":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"grade"},"status":{"const":"done"},"mode":{"type":["string","null"],"enum":["quick","balanced","detailed","agent",null]},"createdAt":{"type":"string","format":"date-time"},"card":{"type":"object","properties":{"name":{"type":["string","null"]},"set":{"type":["string","null"]},"number":{"type":["string","null"]}}},"grade":{"type":"object","properties":{"scale":{"const":"PSA"},"min":{"type":["number","null"]},"max":{"type":["number","null"]}}},"imageCount":{"type":"integer"},"corrected":{"type":"boolean"},"reanalysisOf":{"type":["string","null"]},"links":{"type":"object","properties":{"self":{"type":"string"}}}}},"GradeList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/GradeSummary"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"nextOffset":{"type":["integer","null"]}}},"Set":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"set"},"name":{"type":"string"},"series":{"type":"string"},"printedTotal":{"type":"integer"},"total":{"type":["integer","null"]},"releaseDate":{"type":["string","null"],"format":"date"},"images":{"type":"object","properties":{"logo":{"type":["string","null"]},"symbol":{"type":["string","null"]}}}}},"Card":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"card"},"name":{"type":"string"},"number":{"type":"string"},"rarity":{"type":["string","null"]},"supertype":{"type":["string","null"]},"subtypes":{"type":"array","items":{"type":"string"}},"artist":{"type":["string","null"]},"images":{"type":"object","properties":{"small":{"type":["string","null"]},"large":{"type":["string","null"]}}},"set":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"series":{"type":"string"},"printedTotal":{"type":"integer"},"releaseDate":{"type":["string","null"],"format":"date"}}},"links":{"type":"object","properties":{"self":{"type":"string"},"web":{"type":"string"}}}}},"CardList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"nextOffset":{"type":["integer","null"]},"sets":{"type":"array","items":{"$ref":"#/components/schemas/Set"}}}}}}}