llm utils

Args: request: TokenCountRequest call_endpoint: bool - When set to "True" it will call the token counting endpoint - e.g Anthropic or Google AI Studio Token Counting APIs.

Returns: TokenCountResponse

post/utils/token_counter

Request

  • Base URL
    https://api.flock.io (the document declares no server; this is the origin it was published from)
  • URL
    https://api.flock.io/utils/token_counter
  • Auth
    API key in header x-litellm-api-key

Query parameters

call_endpointboolean

Request body

modelstring required
promptstring nullable
messagesobject[] nullable
contentsobject[] nullable
toolsobject[] nullable
systemunknown

Response

Successful Response

total_tokensinteger required
request_modelstring required
model_usedstring required
tokenizer_typestring required
original_responseobject nullable
errorboolean
error_messagestring nullable
status_codeinteger nullable

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status