Method: documents.estimateReviewCost

Estimates what a review of a document would cost on the caller's Gemini API key.

The estimate comes from what past reviews with the same model and depth cost, adjusted to this document's size and repriced at the Gemini API's current list prices. It covers one review attempt that runs to completion, and doesn't include retries after errors.

HTTP request

POST https://deepreview.googleapis.com/v1/{document=documents/*}:estimateReviewCost

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
document

string

Required. The document to review. It takes the form documents/{document}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "review": {
    object (Review)
  }
}
Fields
review

object (Review)

Required. The review to estimate, as it would be passed to reviews.create. Only its runConfig is read, and geminiApiKey is ignored.

Response body

Response message for estimating what a review would cost. When the cost can't be estimated, for example because too few past reviews used the same model and depth, the costs are unset and pastReviewCount is 0.

If successful, the response body contains data with the following structure:

JSON representation
{
  "lowCost": {
    object (Money)
  },
  "medianCost": {
    object (Money)
  },
  "highCost": {
    object (Money)
  },
  "pastReviewCount": integer
}
Fields
lowCost

object (Money)

The 20th percentile of what comparable past reviews would cost for this document.

medianCost

object (Money)

The median of what comparable past reviews would cost for this document.

highCost

object (Money)

The 95th percentile of what comparable past reviews would cost for this document.

pastReviewCount

integer

Number of past reviews the estimate is based on.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the OAuth 2.0 Overview.

Money

Represents an amount of money with its currency type.

JSON representation
{
  "currencyCode": string,
  "units": string,
  "nanos": integer
}
Fields
currencyCode

string

The three-letter currency code defined in ISO 4217.

units

string (int64 format)

The whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

nanos

integer

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.