API 介紹
專門用於馬賽克內容移除的人工智能技術,通過 MosaicRemoval.com API 變得前所未有的簡單。只需幾行代碼,您就可以將這項技術集成到您的應用程序中。
1
購買套餐
購買專用於 API 的套餐
3
使用代碼示例
使用以下代碼示例快速開始
4
調整參數
參考參數說明調整請求
身份驗證
我們使用特殊的 API 密鑰(或 App Code)對用戶進行身份驗證。您可以在這裡輕鬆獲取。API 密鑰是唯一的,與其他密鑰完全不同。出於安全考慮,請不要公開您的 App Code。
API 端點
POST https://api.mosaicremoval.com/sjccup
請求頭
Authorization:
APPCODE YourAppCode
Content-Type:
application/json; charset=UTF-8
代碼示例
使用我們的代碼示例快速開始
public static void main(String[] args) {
String host = "https://api.mosaicremoval.com";
String path = "/sjccup";
String method = "POST";
String appcode = "YourAppCode";
Map<String, String> headers = new HashMap<String, String>();
// The final format in the header (with a space in between) is Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + appcode);
// Define the corresponding Content-Type according to API requirements
headers.put("Content-Type", "application/json; charset=UTF-8");
Map<String, String> querys = new HashMap<String, String>();
String bodys = "{\"media_id\":\"Base64 encoded image value, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64\",\"keep_distortion\":boolean type, false - auto-corrects distortion, true - disables correction\",\"keep_ori\":boolean type, false - the image will be rotated to the correct orientation, true - retains the orientation when uploaded}";
try {
HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
System.out.println(response.toString());
// Get the body of the response
// System.out.println(EntityUtils.toString(response.getEntity()));
} catch (Exception e) {
e.printStackTrace();
}
}請求參數
使用這些參數配置您的 API 請求
| 參數 | 類型 | 描述 |
|---|---|---|
| media_id | string | 圖片的 Base64 編碼值,最長邊不超過 4000px;移除前綴 data:image/png;base64 |
| keep_distortion | boolean | false – 自動糾正失真,true – 禁用糾正 |
| keep_ori | boolean | false – 圖片將旋轉到正確方向,true – 保持上傳時的方向 |
錯誤代碼
API 響應代碼參考
| 錯誤代碼 | 錯誤信息 | 描述 |
|---|---|---|
| 0 | success | Success |
| 1000 | body error | Request body error |
| 1001 | param error | Request parameter error |
| 1002 | content type error | Content-Type error |
| 1003 | image not exists | Image file not found |
| 1004 | image size error | Image size error |
| 1005 | image format error | Image format error |
| 1006 | invalid signature | Invalid signature |
| 1007 | body size error | Body size error |
| 1008 | no authorization | Authorization failed |
| 2000 | server unknown error | Server unknown error |
| 2001 | server timeout | Server timeout |
| 2003 | no content recognition | No content recognized |
| 2004 | validate data error | Validation data error |
| 3000 | remote server error | Remote server error |
| 4000 | base server error | Base server error |
API 定價方案
以下方案專用於 API
基礎版
$499$0.10 / 積分
5,000 積分
6個月有效期
無風險:7天退款保證
最受歡迎
熱門版
$799$0.08 / 積分
10,000 積分
6個月有效期
無風險:7天退款保證
專屬
專屬版
$3999$0.04 / 積分
100,000 積分
1年有效期
無風險:7天退款保證