Class Cost (0.1.0)
public final class Cost extends GeneratedMessageV3 implements CostOrBuilder
Cost for running a model deployment on a given instance type. Currently, only
USD currency code is supported.
Protobuf type google.cloud.gkerecommender.v1.Cost
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
public static final int COST_PER_MILLION_INPUT_TOKENS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
COST_PER_MILLION_OUTPUT_TOKENS_FIELD_NUMBER
public static final int COST_PER_MILLION_OUTPUT_TOKENS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int OUTPUT_INPUT_COST_RATIO_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
PRICING_MODEL_FIELD_NUMBER
public static final int PRICING_MODEL_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static Cost getDefaultInstance()
| Returns |
| Type |
Description |
Cost |
|
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Cost.Builder newBuilder()
newBuilder(Cost prototype)
public static Cost.Builder newBuilder(Cost prototype)
| Parameter |
| Name |
Description |
prototype |
Cost
|
public static Cost parseDelimitedFrom(InputStream input)
| Returns |
| Type |
Description |
Cost |
|
public static Cost parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
parseFrom(byte[] data)
public static Cost parseFrom(byte[] data)
| Parameter |
| Name |
Description |
data |
byte[]
|
| Returns |
| Type |
Description |
Cost |
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Cost parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
parseFrom(ByteString data)
public static Cost parseFrom(ByteString data)
| Returns |
| Type |
Description |
Cost |
|
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Cost parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
public static Cost parseFrom(CodedInputStream input)
| Returns |
| Type |
Description |
Cost |
|
public static Cost parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
public static Cost parseFrom(InputStream input)
| Returns |
| Type |
Description |
Cost |
|
public static Cost parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
parseFrom(ByteBuffer data)
public static Cost parseFrom(ByteBuffer data)
| Returns |
| Type |
Description |
Cost |
|
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Cost parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Cost |
|
parser()
public static Parser<Cost> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
| Parameter |
| Name |
Description |
obj |
Object
|
Overrides
public Amount getCostPerMillionInputTokens()
Optional. The cost per million input tokens. $/input token = ($/output
token) / output-to-input-cost-ratio.
.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
Amount |
The costPerMillionInputTokens.
|
public AmountOrBuilder getCostPerMillionInputTokensOrBuilder()
Optional. The cost per million input tokens. $/input token = ($/output
token) / output-to-input-cost-ratio.
.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];
getCostPerMillionOutputTokens()
public Amount getCostPerMillionOutputTokens()
Optional. The cost per million output tokens, calculated as:
$/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s +
output tokens/s)
.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
Amount |
The costPerMillionOutputTokens.
|
getCostPerMillionOutputTokensOrBuilder()
public AmountOrBuilder getCostPerMillionOutputTokensOrBuilder()
Optional. The cost per million output tokens, calculated as:
$/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s +
output tokens/s)
.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];
getDefaultInstanceForType()
public Cost getDefaultInstanceForType()
| Returns |
| Type |
Description |
Cost |
|
public float getOutputInputCostRatio()
Optional. The output-to-input cost ratio. This determines how the total GPU
cost is split between input and output tokens. If not provided, 4.0 is
used, assuming a 4:1 output:input cost ratio.
optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
float |
The outputInputCostRatio.
|
getParserForType()
public Parser<Cost> getParserForType()
Overrides
getPricingModel()
public String getPricingModel()
Optional. The pricing model used to calculate the cost. Can be one of:
3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot
will be used.
string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
String |
The pricingModel.
|
getPricingModelBytes()
public ByteString getPricingModelBytes()
Optional. The pricing model used to calculate the cost. Can be one of:
3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot
will be used.
string pricing_model = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
ByteString |
The bytes for pricingModel.
|
getSerializedSize()
public int getSerializedSize()
| Returns |
| Type |
Description |
int |
|
Overrides
public boolean hasCostPerMillionInputTokens()
Optional. The cost per million input tokens. $/input token = ($/output
token) / output-to-input-cost-ratio.
.google.cloud.gkerecommender.v1.Amount cost_per_million_input_tokens = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
boolean |
Whether the costPerMillionInputTokens field is set.
|
hasCostPerMillionOutputTokens()
public boolean hasCostPerMillionOutputTokens()
Optional. The cost per million output tokens, calculated as:
$/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s +
output tokens/s)
.google.cloud.gkerecommender.v1.Amount cost_per_million_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
boolean |
Whether the costPerMillionOutputTokens field is set.
|
public boolean hasOutputInputCostRatio()
Optional. The output-to-input cost ratio. This determines how the total GPU
cost is split between input and output tokens. If not provided, 4.0 is
used, assuming a 4:1 output:input cost ratio.
optional float output_input_cost_ratio = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns |
| Type |
Description |
boolean |
Whether the outputInputCostRatio field is set.
|
hashCode()
| Returns |
| Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Cost.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Cost.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
| Returns |
| Type |
Description |
Object |
|
Overrides
toBuilder()
public Cost.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-17 UTC."],[],[]]