Get token usage
POST/api/v2/agent/token-usage
Returns the number of tokens used in a text,if it returns -1 either property is null or empty, else it returns the number of tokens used.
Request
Query Parameters
culture string
Use this param to override the culture of the response. Options: - en (default) - es
- application/json-patch+json
- application/json
- text/json
- application/*+json
Body
text stringnullable
encodingName stringnullable
model stringnullable
Body
text stringnullable
encodingName stringnullable
model stringnullable
Body
text stringnullable
encodingName stringnullable
model stringnullable
Body
text stringnullable
encodingName stringnullable
model stringnullable
Responses
- 200
- 400
- 401
- 403
- 500
Success
There was a validation error. Please check your request data.
- application/json
- Schema
- Example (from schema)
Schema
message stringnullable
errors
object
nullable
property name* string
{
"message": "string",
"errors": {}
}
The user is unauthorized or the session expired
The user does not have permission
There was an unexpected error
Loading...