Cloud Key Management Service has both traditional REST/HTTP and
[gRPC](http://grpc.io) interfaces. If you don't want to use our
[client libraries](https://docs.cloud.google.com/kms/docs/reference/libraries.md.txt) to access the
Cloud Key Management Service API, you have the option of writing your own client libraries that
use its REST/HTTP or gRPC API surface. We recommend this approach only if your
programming language or other needs are not met by the provided client
libraries.

## gRPC API

You can generate your own gRPC client libraries in any gRPC-supported language
for the Cloud Key Management Service API from its .proto service definition using these resources:

- [Using gRPC with Cloud KMS](https://docs.cloud.google.com/kms/docs/grpc.md.txt)
- [Cloud KMS service definition](https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto)
- [gRPC documentation](http://www.grpc.io/docs/): Everything you need to generate and use your own gRPC client code.
- [RPC API Reference](https://docs.cloud.google.com/kms/docs/reference/rpc.md.txt): Language-independent overview of the RPC surface.

## REST/HTTP API

There are a number of options for interacting with a service's REST interface.
To create your own clients, use the following resources:

- [REST API Reference](https://docs.cloud.google.com/kms/docs/reference/rest.md.txt)
- [Guidelines for working with Google HTTP APIs](https://cloud.google.com/apis/docs/http)
- [API Discovery Service](https://developers.google.com/discovery/v1/getting_started): Exposes machine readable metadata about the REST/HTTP API surface, useful for creating client libraries, tools, and plugins.
- [Directory of client samples](https://developers.google.com/discovery/libraries) built with REST/HTTP APIs and the Google API Discovery Service.

## Service Endpoints

Cloud KMS has global and locational service endpoints. The global
REST/HTTP endpoint is `https://cloudkms.googleapis.com` and the
global gRPC endpoint is `cloudkms.googleapis.com`. The global
endpoint routes requests to a locational service in the
[location](https://docs.cloud.google.com/kms/docs/locations.md.txt) specified by the resource name.

The locational REST/HTTP endpoints are
`https://\<region\>-cloudkms.googleapis.com` and the
locational gRPC endpoints are
`\<region\>-cloudkms.googleapis.com`, substituting
`\<region\>` for any of the supported regional,
dual-regional, or multi-regional
[Cloud KMS locations](https://docs.cloud.google.com/kms/docs/locations.md.txt). These endpoints are isolated by
location, meaning each endpoint routes requests to a locational service in the
location specified by the endpoint name. If the location specified by the
resource name doesn't match the location specified by the endpoint, the request
will fail.