GET

/v1/schemas/google-vertex/chat/v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:countTokens?kind=output

kind outputactivity chathash 2d015745…extracted Oct 7, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
c53822c7158de0461a16c06223d306d1a32575088879045c6cc5e9ffe21cd46c
{
  "fetchedAt": 1791350027,
  "extractorVersion": "1",
  "verifiedAt": null
}

Response body

3 properties · 0 required · 1 $defs
propertytypedescriptionconstraints
promptTokensDetailsGoogleCloudAiplatformV1ModalityTokenCount[]Output only. List of modalities that were processed in the request input.
totalBillableCharactersintegerThe total number of billable characters counted across all instances from the request.format: int32
totalTokensintegerThe total number of tokens counted across all instances from the request.format: int32

Types

1 $defs

GoogleCloudAiplatformV1ModalityTokenCountobject

Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is pa…

tokenCountintegerThe number of tokens counted for this modality.format: int32
modalityenumThe modality that this token count applies to.MODALITY_UNSPECIFIED | TEXT | IMAGE | VIDEO | AUDIO | DOCUMENT

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"google-vertex","endpointId":"v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:countTokens","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}