GET
/v1/schemas/google-vertex/chat/v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/models/{modelsId}:countTokens?kind=output
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source tracec53822c7158de0461a16c06223d306d1a32575088879045c6cc5e9ffe21cd46c{
"fetchedAt": 1791350027,
"extractorVersion": "1",
"verifiedAt": null
} |
Response body
3 properties · 0 required · 1 $defs| property | type | description | constraints |
|---|---|---|---|
| promptTokensDetails | GoogleCloudAiplatformV1ModalityTokenCount[] | Output only. List of modalities that were processed in the request input. | |
| totalBillableCharacters | integer | The total number of billable characters counted across all instances from the request. | format: int32 |
| totalTokens | integer | The total number of tokens counted across all instances from the request. | format: int32 |
Types
1 $defsGoogleCloudAiplatformV1ModalityTokenCountobject
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…
| tokenCount | integer | The number of tokens counted for this modality. | format: int32 |
| modality | enum | The modality that this token count applies to. | MODALITY_UNSPECIFIED | TEXT | IMAGE | VIDEO | AUDIO | DOCUMENT |
Validate a payload
before you spend tokensshell
$ 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", …}]}