Get API Usage

Returns prediction usage on a monthly basis for the current calendar month and future months. Each apiusage object in the response corresponds to a calendar month in your plan. For more information about plans, see Rate Limits.

Response Body

Name

Type

Description

Available Version

data

object

Array of apiusage objects.

1.0

object

string

Object returned; in this case, list.

1.0

apiUsage Response Body

Name

Type

Description

Available Version

endsAt

date

Date and time that the plan calendar month ends. Always 12 am on the first day of the following month.

1.0

id

long

Unique ID for the API usage plan month.

1.0

licenseId

string

Unique ID of the API plan.

1.0

object

string

Object returned; in this case, apiusage.

1.0

organizationId

long

Unique ID for the user making the API call.

1.0

predictionsMax

long

Total number of predictions for the calendar month.

1.0

predictionsRemaining

long

Number of predictions left for the calendar month.

1.0

predictionsUsed

long

Number of predictions used in the calendar month. A prediction is any call to these resources:

  • /detect
  • /entities
  • /intent
  • /ocr
  • /predict
  • /sentiment

1.0

startsAt

date

Date and time that the plan calendar month begins. Always the first of the month.

1.0

planData Response Body

Name

Type

Description

Available Version

amount

string

Number of plans of the specified type.

1.0

plan

string

Type of plan based on the source. Valid values:

  • HEROKU

  • STARTER—2,000 predictions per calendar month.

  • BRONZE—10,000 predictions per calendar month.

  • SILVER—250,000 predictions per calendar month.

  • GOLD—One million predictions per calendar month.

  • SALESFORCE

  • STARTER—2,000 predictions per calendar month.

  • SFDC_1M_EDITION—One million predictions per calendar month.

1.0

source

string

Service that provisioned the plan. Valid values:

  • HEROKU
  • SALESFORCE

1.0

Each apiusage object in the response contains plan information for a single calendar month for a single license. If you have a six-month paid plan and you make this call on the first month, the response contains six apiusage objects; one for each calendar month in the plan.

  • If you're using the free tier, the response contains plan information only for the current month. You see plan information only after you make your first prediction. If you call the /apiusage resource before you make your first prediction call, the API returns an empty array.
  • If you're using the paid tier, the response contains plan information for each month in your plan starting with the current month.

The planData array contains an object for each plan type associated with the calendar month and the license. This code snippet shows the planData if the user has two Heroku GOLD plans.

"planData": [
       {
         "plan": "GOLD",
         "amount": 2,
         "source": "HEROKU"
       }
     ]
Language