> For the complete documentation index, see [llms.txt](https://docs.blockchainsecurity.asia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockchainsecurity.asia/api-reference/readme/risk-and-intelligence/di-zhi-lei-xing-fen-lei.md).

# 地址類型分類

使用機器學習判斷一批地址可能屬於的類型，例如交易所、DeFi 或混幣器，並回傳信心分數。單次最多 100 個地址。

本端點只看鏈上行為特徵做統計推測，**不查情資庫、不回風險分數**。要「這個地址是誰」請用 `/v1/labels`；要可量化的風險結論請用 `/v1/address-risk`。

結果順序與請求的 `addresses` 一致。單一地址分析失敗時該筆的 `predicted_class` 為 null、 `error` 有值，整批仍回 200——請逐筆檢查而不是只看 HTTP 狀態碼。

## POST /v1/address-classify

>

```json
{"openapi":"3.1.0","info":{"title":"Blockchain Atlantis API Gateway","version":"0.1.0"},"tags":[{"description":"使用機器學習判斷一批地址可能屬於的類型，例如交易所、DeFi 或混幣器，並回傳信心分數。單次最多 100 個地址。\n\n本端點只看鏈上行為特徵做統計推測，**不查情資庫、不回風險分數**。要「這個地址是誰」請用\n`/v1/labels`；要可量化的風險結論請用 `/v1/address-risk`。\n\n結果順序與請求的 `addresses` 一致。單一地址分析失敗時該筆的 `predicted_class` 為 null、\n`error` 有值，整批仍回 200——請逐筆檢查而不是只看 HTTP 狀態碼。","name":"地址類型分類"}],"servers":[{"description":"Production","url":"https://api.blockchainsecurity.asia"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"in":"header","name":"X-API-Key","type":"apiKey"}},"schemas":{"ClassifyRequest":{"description":"`POST /v1/address-classify` 的請求 body。","properties":{"addresses":{"description":"要分類的地址清單。不可為空，單次最多 100 筆，且格式須與 `blockchain` 相符。","items":{"type":"string"},"type":"array"},"blockchain":{"description":"區塊鏈網路名稱。支援 `tron`（預設）、`ethereum`、`bitcoin`。\n\n省略時為 `tron`——若你送的是其他鏈的地址，會因格式不符而回 400，不會被誤判成 Tron 地址。","type":"string"}},"required":["addresses"],"type":"object"},"AddressClassification":{"description":"單一地址的分類結果。","properties":{"address":{"description":"對應的地址（原樣回傳）。","type":"string"},"confidence":{"description":"預測信心，0.0–1.0。分類失敗時為 0。","format":"double","type":"number"},"error":{"description":"該地址分類失敗的說明；成功時為 `null`。\n\n單一地址失敗**不會**讓整批請求失敗，整體仍回 200。","type":["string","null"]},"predicted_class":{"description":"預測類型。該地址分類失敗時為 `null`（此時 `error` 有值）。\n\n可能值依鏈而異：\n- **Tron**：`Exchange`、`Deposit`、`Defi`、`Mixer`、`Scam`、`Unknown`\n- **Ethereum**：`Exchange`、`Deposit`、`Defi`、`Mixer`、`Scam`\n- **Bitcoin**：`Exchange`、`Deposit`、`Defi`、`ColdWallet`、`MiningPool`、`Scam`\n\n模型改版時可能新增類別，請以「未知字串」的方式寬容處理，不要用窮舉 match。","type":["string","null"]}},"required":["address","confidence"],"type":"object"},"Meta":{"description":"回應的中繼資訊。所有欄位都是 `Option`，沒有的就不會出現在 JSON 裡\n（搭配 `skip_serializing_if`），維持輸出乾淨。","properties":{"credit_cost":{"description":"本次請求扣掉的 credit 數量（計費後填入）。","format":"int64","type":["integer","null"]},"credit_remaining":{"description":"本次請求後剩餘的 credit 餘額。","format":"int64","type":["integer","null"]},"pagination":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PaginationMeta","description":"分頁資訊（僅列表型 endpoint 會帶）。"}]},"request_id":{"description":"本次請求的唯一識別碼，與 log / 追蹤系統對應，方便客訴時定位。","type":["string","null"]}},"type":"object"},"PaginationMeta":{"description":"對外的分頁中繼資訊。","properties":{"limit":{"format":"int32","minimum":0,"type":"integer"},"offset":{"format":"int32","minimum":0,"type":"integer"},"total":{"description":"符合條件的總筆數（若下游能提供）。","format":"int64","minimum":0,"type":["integer","null"]}},"required":["limit","offset"],"type":"object"},"ErrorResponse":{"description":"對外錯誤信封。與成功回應的 [`crate::response::ApiResponse`] 結構對稱，\n客戶端永遠拿到 `{ \"error\": { \"code\": ..., \"message\": ... } }`。\n\n同時是 OpenAPI 的錯誤 schema：所有非 2xx 回應都是這個形狀，端點文件以\n`body = ErrorResponse` 引用它，客戶端只要寫一次錯誤解析。","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"required":["error"],"type":"object"},"ErrorDetail":{"description":"錯誤本體。`code` 是穩定的機器可讀字串（比 HTTP 狀態碼細緻），\n`message` 是給人看的說明，不保證格式穩定——請用 `code` 做程式判斷。","properties":{"code":{"description":"機器可讀錯誤碼，例如 `bad_request` / `insufficient_credit` / `gateway_timeout`。","type":"string"},"message":{"description":"人可讀的錯誤說明。","type":"string"}},"required":["code","message"],"type":"object"}}},"paths":{"/v1/address-classify":{"post":{"operationId":"classify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"統一成功回應信封。\n\n- `data`：實際的業務資料（泛型 `T`，必須可序列化）。\n- `meta`：與這次請求有關的中繼資訊（request id、分頁、credit 用量等）。","properties":{"data":{"description":"地址分類結果。","properties":{"results":{"description":"每個地址一筆，**順序與請求的 `addresses` 相同**。","items":{"$ref":"#/components/schemas/AddressClassification"},"type":"array"}},"required":["results"],"type":"object"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"type":"object"}}},"description":"分類完成，回傳每個地址的預測類型與信心分數"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"請求參數有誤：缺少必填欄位、鏈別不支援、地址清單為空或超過 100 筆，或地址格式與鏈不符"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"缺少或無效的 API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"點數餘額不足"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"目前方案不含此端點"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"請求過於頻繁，請依 Retry-After 退避後重試"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"伺服器內部錯誤"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"後端服務暫時無法回應，請稍後重試"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"後端服務暫時過載，請退避後重試"},"504":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"分類逾時（一次送較多地址時較容易發生），請縮小批次後重試"}},"summary":"","tags":["地址類型分類"]}}}}
```
