Check API Quota API Reference

By making a simple API request, you can obtain real-time information about the remaining quota of the connected APIs, ensuring that you are always aware of the latest usage status. It is recommended for daily checks; frequent calls may result in slower response times.

Request Parameters

Parameter

Type

Required

Description

apiPath

String

Yes

The path of the API to be queried

Sample value:"/ai/image/translation"

Sample Request

The maximum response time for the interface is 30 seconds. It is recommended to set the maximum request time to no more than 30 seconds.

  • For other programming languages, please refer to ''Quick Start''.

IopClient client = new IopClientImpl(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/query/balance");
// If you have not purchased a formal quota, please add a trial marker; otherwise, you will receive the NoResource error code.
// request.addHeaderParameter("x-iop-trial","true");
request.addApiParameter("apiPath", "/ai/image/translation");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Parameter Response

Parameter

Type

Description

code

String

Response code;0 indicates a successful call, other response codes can be referred to in the error code information.

data

Object

The response structure

data.balance

Number

API remaining quota

request_id

String

Request ID: Used to uniquely identify a single request call.

success

Boolean

Whether successful;true is successful,false is unsuccessful.

Sample Response

{
    "data": {
        "balance": 17047245
    },
    "success": true,
    "code": "0",
    "request_id": "212a6bb617481682503803141",
    "_trace_id_": "2151f31917481682503744825eae2f"
}

Error Code

Code

Error code

Description

500

system error

System error

700

invalid input

The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements.

Last updated

Was this helpful?