praniSheba API

Tokens and billing

An enroll or identify call that succeeds uses one token; failed calls, deletes and listings are free.

What costs a token

Token use by call
CallResultCost
EnrollThe model returns 200: the cow is enrolled1 enroll token
EnrollAny error: blurry photo, duplicate cow id, duplicate muzzle, bad input, server errorFree
IdentifyThe model returns 200, whether or not a match was found1 search token
IdentifyAny error: blurry photo, nothing enrolled yet, bad input, server error, timeoutFree
Delete, list cowsAny resultFree

A search that runs and finds no match costs one token. Every failure is free.

Balances

  • Search tokens pay for identify calls and enroll tokens pay for enroll calls. They are separate balances.
  • Tokens never expire.
  • Buy tokens on the Buy tokens page of your dashboard. Larger packs cost less per token.
  • X-Tokens-Remaining on enroll and identify responses shows your balance of that call's token type.

Refunds

A token is reserved when an enroll or identify call starts. If the call fails, the token is returned straight away and your usage log shows the call as refunded.

If the platform itself fails mid-call, for example it restarts, the reserved token is returned automatically, normally within 15 minutes. Until then X-Tokens-Remaining may show it as used.

If you stop waiting yourself, the call may still complete and be charged. Look the request up by its X-Request-Id in your usage log.

With no tokens of the needed type left, enroll and identify return 402 and nothing is charged.