endpoints

POST /v1/endpoints/{endpointsId}:countTokens

Perform a token counting.

Request

  • Base URL
    https://aiplatform.googleapis.com
  • Auth
    OAuth 2 and OAuth 2
    Implicithttps://accounts.google.com/o/oauth2/auth
    Scopeshttps://www.googleapis.com/auth/cloud-platform
    Authorization codehttps://accounts.google.com/o/oauth2/auth
    Token URLhttps://accounts.google.com/o/oauth2/token
    Scopeshttps://www.googleapis.com/auth/cloud-platform
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

endpointsIdstring required

Request body

modelstring

Optional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

Response

Successful response

totalBillableCharactersinteger

The total number of billable characters counted across all instances from the request.

totalTokensinteger

The total number of tokens counted across all instances from the request.

Changes

No recorded changes to this operation across all 8 revisions of this API.