# AnnotateImageRequest

- [JSON representation](https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#SCHEMA_REPRESENTATION)
- [Image](https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#Image)
  - [JSON representation](https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#Image.SCHEMA_REPRESENTATION)
- [ImageSource](https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#ImageSource)
  - [JSON representation](https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#ImageSource.SCHEMA_REPRESENTATION)

Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.

| JSON representation ||
|---|---|
| ``` { "image": { object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#Image`) }, "features": [ { object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/Feature`) } ], "imageContext": { object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/ImageContext`) } } ``` |

| Fields ||
|---|---|
| `image` | ``object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#Image`)`` The image to be processed. |
| `features[]` | ``object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/Feature`)`` Requested features. |
| `imageContext` | ``object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/ImageContext`)`` Additional context that may accompany the image. |

## Image

Client image to perform Google Cloud Vision API tasks over.

| JSON representation ||
|---|---|
| ``` { "content": string, "source": { object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#ImageSource`) } } ``` |

| Fields ||
|---|---|
| `content` | `string (https://developers.google.com/discovery/v1/type-format format)` Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. A base64-encoded string. <br /> |
| `source` | ``object (`https://docs.cloud.google.com/vision/product-search/docs/reference/rest/v1/AnnotateImageRequest#ImageSource`)`` Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request. |

## ImageSource

External image source (Google Cloud Storage or web URL image location).

| JSON representation ||
|---|---|
| ``` { "gcsImageUri": string, "imageUri": string } ``` |

| Fields ||
|---|---|
| `gcsImageUri` | `string` **Use `imageUri` instead.** The Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. <br /> |
| `imageUri` | `string` The URI of the source image. Can be either: 1. A Google Cloud Storage URI of the form `gs://bucket_name/object_name`. Object versioning is not supported. See [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed. Your request may fail if the specified host denies the request (e.g. due to request throttling or DOS prevention), or if Google throttles requests to the site for abuse prevention. You should not depend on externally-hosted images for production applications. When both `gcsImageUri` and `imageUri` are specified, `imageUri` takes precedence. <br /> |