Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Optional. The instances that are the input to token computing API call.
Schema is identical to the prediction schema of the text model, even for
the non-text models, like chat models, or Codey models.
Optional. The instances that are the input to token computing API call.
Schema is identical to the prediction schema of the text model, even for
the non-text models, like chat models, or Codey models.
Optional. The instances that are the input to token computing API call.
Schema is identical to the prediction schema of the text model, even for
the non-text models, like chat models, or Codey models.
Optional. The instances that are the input to token computing API call.
Schema is identical to the prediction schema of the text model, even for
the non-text models, like chat models, or Codey models.
Optional. The instances that are the input to token computing API call.
Schema is identical to the prediction schema of the text model, even for
the non-text models, like chat models, or Codey models.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Interface ComputeTokensRequestOrBuilder (1.32.0)\n\n public interface ComputeTokensRequestOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getContents(int index)\n\n public abstract Content getContents(int index)\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsCount()\n\n public abstract int getContentsCount()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsList()\n\n public abstract List\u003cContent\u003e getContentsList()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsOrBuilder(int index)\n\n public abstract ContentOrBuilder getContentsOrBuilder(int index)\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsOrBuilderList()\n\n public abstract List\u003c? extends ContentOrBuilder\u003e getContentsOrBuilderList()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getEndpoint()\n\n public abstract String getEndpoint()\n\nRequired. The name of the Endpoint requested to get lists of tokens and\ntoken ids.\n\n`\nstring endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }\n`\n\n### getEndpointBytes()\n\n public abstract ByteString getEndpointBytes()\n\nRequired. The name of the Endpoint requested to get lists of tokens and\ntoken ids.\n\n`\nstring endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }\n`\n\n### getInstances(int index)\n\n public abstract Value getInstances(int index)\n\nOptional. The instances that are the input to token computing API call.\nSchema is identical to the prediction schema of the text model, even for\nthe non-text models, like chat models, or Codey models.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesCount()\n\n public abstract int getInstancesCount()\n\nOptional. The instances that are the input to token computing API call.\nSchema is identical to the prediction schema of the text model, even for\nthe non-text models, like chat models, or Codey models.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesList()\n\n public abstract List\u003cValue\u003e getInstancesList()\n\nOptional. The instances that are the input to token computing API call.\nSchema is identical to the prediction schema of the text model, even for\nthe non-text models, like chat models, or Codey models.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesOrBuilder(int index)\n\n public abstract ValueOrBuilder getInstancesOrBuilder(int index)\n\nOptional. The instances that are the input to token computing API call.\nSchema is identical to the prediction schema of the text model, even for\nthe non-text models, like chat models, or Codey models.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesOrBuilderList()\n\n public abstract List\u003c? extends ValueOrBuilder\u003e getInstancesOrBuilderList()\n\nOptional. The instances that are the input to token computing API call.\nSchema is identical to the prediction schema of the text model, even for\nthe non-text models, like chat models, or Codey models.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getModel()\n\n public abstract String getModel()\n\nOptional. The name of the publisher model requested to serve the\nprediction. Format:\nprojects/{project}/locations/{location}/publishers/\\*/models/\\*\n\n`string model = 3 [(.google.api.field_behavior) = OPTIONAL];`\n\n### getModelBytes()\n\n public abstract ByteString getModelBytes()\n\nOptional. The name of the publisher model requested to serve the\nprediction. Format:\nprojects/{project}/locations/{location}/publishers/\\*/models/\\*\n\n`string model = 3 [(.google.api.field_behavior) = OPTIONAL];`"]]