Cloud Endpoints in Google Cloud
A friendly, complete guide to putting a smart front door on your APIs. Learn how to describe an API, protect it, limit its use, watch its health, and decide whether Cloud Endpoints, API Gateway, or a larger platform is the right fit.
Imagine a large office building with many departments. Visitors do not walk straight into any room they like. They go to the reception desk first. The receptionist checks who they are, whether they have an appointment, and which department they need. The receptionist also keeps a visitor book, so the building knows how many people came, when, and why. And if one visitor keeps coming back every minute and disturbing staff, the receptionist politely asks them to slow down.
An API is a door into your software, and Cloud Endpoints is the reception desk for that door. It sits in front of your service, checks each caller, enforces rules, and records everything that happens, while your own code stays focused on its real job. In this guide you will learn what APIs and API management are, how Cloud Endpoints works, how to describe your API, how to add security and limits, how to watch it, and how it compares with the other API tools in Google Cloud.
Google Cloud offers several API tools: Cloud Endpoints, API Gateway, and Apigee, along with load balancers and service mesh tools. Their roles overlap, and Google’s recommendations about which to use for new work have changed over time. This guide explains the ideas that stay stable and describes details in general terms. Before you start a real project, confirm in the official documentation which tool is currently recommended for your needs, plus the current limits, supported specification versions, and prices.
1What Is Cloud Endpoints?
Start with the big picture before we meet the details.
The simple definition
Cloud Endpoints is an API management system. It helps you develop, deploy, protect, and monitor APIs that run on Google Cloud. You describe your API in a standard file. Cloud Endpoints then runs a small proxy in front of your service, which checks each request against the rules you set, forwards good requests to your backend, and reports what happened for monitoring and billing.
Think of a bank counter in front of a vault. Customers do not enter the vault. They talk to the cashier, who checks their identity, confirms they are allowed to do what they ask, writes it all in a ledger, and then fetches the item from the vault. The vault, which is your backend, never needs to do any of that checking itself.
Why it exists
Every API needs the same extra features: checking who is calling, limiting how much each caller may use, keeping logs, producing charts, and handling versions. If every team builds these in every service, the work is repeated, and mistakes creep in. Cloud Endpoints moves these shared jobs into one place, in front of the service, so developers write business logic and nothing else.
Where it is used
Teams use it to publish REST APIs and gRPC services to mobile apps, websites, partners, and other internal systems, running on Cloud Run, Kubernetes Engine, Compute Engine, and App Engine.
2API Basics You Must Know
A few simple ideas make everything else easy.
API
A set of rules that lets one program ask another program to do something or return some data, without knowing how it works inside.
REST
A popular style of API that uses ordinary web addresses and verbs such as get, create, update, and delete.
gRPC
A fast, compact style of API for service-to-service calls, using a strict contract file written in a format called protocol buffers.
Endpoint
One specific web address and method that a client can call, such as “get the list of orders”.
Specification
A written description of every endpoint, what it accepts, and what it returns. A contract between the API and its users.
Gateway or proxy
A middle layer that receives calls, applies rules, and forwards them to the real service.
Keys, tokens, and who is calling
Three words are often mixed up. An API key is a simple code that identifies the project or app making a call. It is useful for counting usage and applying quotas, but it is not strong proof of a person’s identity. A token, such as a JSON Web Token or JWT, is a signed note that proves who the caller is and what they may do, and it is issued by a trusted identity provider. A service account is an identity for programs, used when one service calls another.
An API key is like a library membership number printed on a card: it tells the library which account is borrowing, but anyone who finds the card could use it. A token is like a passport stamped by a trusted office, with a photo and an expiry date. For anything important, you want the passport.
Quotas and rate limits
A quota limits how much a caller can use in a period, such as ten thousand requests per day. A rate limit limits how fast, such as ten requests per second. They protect your backend from overload, make costs predictable, and let you offer different service levels to different users.
3Architecture and Components
Here is how a request reaches your service through Cloud Endpoints.
flowchart LR
A["Client such as mobile app, website, or partner"] --> B["Extensible Service Proxy"]
B --> C["Your backend service"]
B D["Service Control for check and report"]
E["API specification file"] --> F["Service Management"]
F --> G["Service configuration"]
G --> B
D --> H["Cloud Monitoring"]
D --> I["Cloud Logging"]
B --> J["Cloud Trace"]
K["Identity provider for tokens"] -.-> B
The main parts
API specification
Your written contract, usually in the OpenAPI format for REST, or a protocol buffers description for gRPC.
Service Management
The Google Cloud service that stores your API configuration and its versions, and decides which one is active.
Extensible Service Proxy
A small, fast proxy based on the Envoy or NGINX technology. It runs in front of your service, reads the configuration, and enforces the rules on every call. The newer version is called ESPv2.
Service Control
The service the proxy asks “may this caller proceed?” and tells “this call just happened”. It handles checks, quotas, and reporting.
Your backend
The real code that does the work. It may run on Cloud Run, Kubernetes, virtual machines, or App Engine.
Observability tools
Cloud Monitoring, Cloud Logging, and Cloud Trace, which receive data about every call.
Where the proxy runs
You can run the proxy in several ways: as a sidecar container next to each service instance, as a separate gateway service that forwards to many backends, or built into your platform choice, for example a container in front of a Cloud Run service. A sidecar is the closest to the service and adds almost no network hop. A central gateway is easier to manage as one unit. Choose by how your teams and traffic are organised.
A sidecar proxy is a personal assistant sitting beside every employee, screening their calls. A central gateway is one front desk for the whole building. The assistant is closer and faster for each person. The front desk is simpler to run and to change.
4Describing Your API with a Specification
Everything in Cloud Endpoints starts from a written description of your API.
OpenAPI for REST
OpenAPI is an open standard for describing REST APIs in a structured text file. It lists each path, the methods allowed on it, the inputs, the outputs, and the security rules. Cloud Endpoints has historically worked with the older version of this standard, known as OpenAPI 2.0 or Swagger. Support for newer versions may differ, so check the current documentation before choosing a format.
What the file contains
| Section | What it describes | Why it matters |
|---|---|---|
| Information | The name, version, and description of the API | Helps users know what they are calling |
| Host | The service name, which is the API’s own address | Cloud Endpoints identifies your API by this name |
| Paths and methods | Every endpoint, what it accepts, and what it returns | The proxy only lets through calls that match the contract |
| Security definitions | How callers prove who they are, such as API keys or tokens | Controls access to each path |
| Backend settings | Where to forward requests, and how to rewrite the path | Connects the front door to the real service |
| Quota settings | Named limits and which paths consume them | Protects the backend and shapes usage |
Special Google extensions
Google adds extra fields, which begin with “x-google”, to carry features that the standard does not cover. These include the backend address and path handling, the trusted token issuers and the keys used to verify them, the allowed audiences, and the quota metrics and limits. Because these are part of the specification, your API’s security and limits live next to its description, are reviewed with it, and are saved in version control with it.
gRPC services
For gRPC, you provide a compiled description of your service, plus a short configuration file in YAML that sets the name, the authentication rules, and optionally the mapping of gRPC calls to ordinary web-style calls. This gives you a strongly typed contract and fast communication between services, while still allowing browser and mobile clients to use a friendly web style when you enable the mapping.
Write the specification first, then build the service to match it. This approach, called design-first, lets teams agree on the contract early, generate client code, create mock servers, and avoid arguments later about what each field means.
5How a Request Is Handled Inside
Follow one call from the client to your backend and back.
sequenceDiagram
participant C as Client
participant P as Extensible Service Proxy
participant SC as Service Control
participant B as Backend Service
C->>P: Request with API key or token
P->>P: Match path and method to the specification
P->>P: Validate the token signature and claims
P->>SC: Check key, quota, and service status
SC-->>P: Allowed or denied
alt Allowed
P->>B: Forward the request
B-->>P: Response
P-->>C: Response returned to the client
else Denied
P-->>C: Error such as unauthorised or too many requests
end
P->>SC: Report the call with size, time, and status
The steps in words
Match. The proxy compares the call with the paths and methods in your specification. An unknown path is refused straight away, which keeps accidental or probing calls away from your backend.
Authenticate. If a token is required, the proxy checks its signature using the issuer’s public keys, checks that it has not expired, and confirms that the issuer and the intended audience are the ones you listed. If an API key is required, it checks that the key exists and is allowed.
Check. The proxy asks Service Control whether this caller may proceed, including whether the service is enabled for the calling project and whether a quota would be exceeded. To save time, results are cached for a short while, and the proxy reports in batches.
Forward. If everything is fine, the proxy forwards the request to your backend, and may add a header that carries details about the verified caller, so your code does not repeat the work.
Report. After the response, the proxy reports the call to Service Control, which feeds your charts and logs.
The cashier does not phone the head office for every tiny sale. The cashier keeps a list of recently approved customers, checks the list first, and sends the day’s records in bundles. That is why the added delay for each call is small.
Failure behaviour
Think about what should happen if the control service is slow or unreachable. The proxy has settings and caching that help it keep serving known callers for a short time. Know how your chosen version behaves, test failure cases, and set timeouts on both the proxy and the backend, so a stuck call does not hold up resources.
6Authentication and Authorisation
The most important job of an API front door is deciding who may come in.
flowchart TD
A["Who is calling your API"] --> B{"A person using an app"}
B -->|"Yes"| C["User tokens from Firebase, Auth0, Google, or another trusted provider"]
B -->|"No"| D{"Another Google Cloud service"}
D -->|"Yes"| E["Service account with a signed ID token"]
D -->|"No"| F{"A partner or public developer"}
F -->|"Yes"| G["API key for usage tracking plus a token for identity"]
F -->|"No"| H["Private access only, with network controls"]
C --> I["Proxy verifies signature, issuer, audience, expiry"]
E --> I
G --> I
Methods supported
| Method | What it proves | Best for |
|---|---|---|
| API key | Which project or app is calling | Counting usage and applying quotas. Not a strong user identity. |
| JWT from an identity provider | Which user or app is calling, and what claims they hold | Mobile and web apps with signed-in users |
| Google ID token for a service account | Which Google Cloud service is calling | Calls between your own services |
| Multiple together | Both project usage and identity | Public or partner APIs that need billing, quotas, and strong identity |
How token checking is configured
In the specification you list each trusted issuer, the address of its public keys, and the audiences that your API accepts. A token is accepted only if it is signed by one of the listed issuers, intended for your API, and not expired. Different paths may require different methods, or none at all, such as a public health check.
Authorisation: what are they allowed to do?
Authentication says who someone is. Authorisation says what they may do. The proxy can pass the verified identity and claims to your backend, which then makes business decisions, such as “this user may only see their own orders”. Never assume that a proven identity means unlimited access.
An API key alone is not security. Keys are easy to copy from a mobile app or a web page. Use keys to identify and count usage, and use tokens to prove identity. Also restrict each key to the services and, where possible, the apps or addresses that should use it.
A visitor badge that says “Guest” identifies someone as a visitor. It does not say which rooms they may enter. A good building checks the badge at the door, and then each room checks the badge’s permissions again.
7Quotas and Rate Limiting
Limits keep your service healthy and your bills predictable.
How quotas are described
In the specification you define named metrics, such as “read requests”, and limits attached to them, such as “one hundred per minute for each consumer project”. Then you mark which paths use which metric, and how much each call costs. For example, a simple lookup may cost one unit and a heavy report may cost ten. Limits can apply per project, so each customer has their own allowance, which is why API keys matter for quotas.
Protect the backend
A caller in a loop or an attacker cannot flood your service, because the front door refuses calls once the limit is reached.
Be fair to all callers
One heavy user cannot use up everything and slow others down.
Offer service levels
Different limits for free, standard, and premium users can be set through different projects or limits.
Control cost
Expensive operations can be rationed, so usage stays within what your budget supports.
What callers see
When a limit is exceeded, the proxy answers with a clear error, usually the “too many requests” status. Good clients react by waiting and trying again with growing delays. Publish your limits in your documentation, so developers can design for them.
Quotas are not security
Quotas reduce abuse, but a determined attacker may use many keys or many projects. For broad protection against attacks, combine quotas with a web application firewall, bot protection, network limits, and monitoring.
Start with generous limits and watch real usage, then tighten. Starting too strict can break your own clients by surprise. Add an alert when a consumer uses most of their quota, so you can contact them before they hit the wall.
8Deployment and Lifecycle
An API has a life from first design to retirement. Cloud Endpoints supports each stage.
flowchart LR
A["Design the API contract"] --> B["Write the specification"]
B --> C["Deploy the configuration to Service Management"]
C --> D["Configuration receives an identifier"]
D --> E["Build or select the proxy container with that configuration"]
E --> F["Deploy the backend and proxy to Cloud Run, GKE, or VMs"]
F --> G["Test, monitor, and gather feedback"]
G --> H{"Change needed"}
H -->|"Yes"| B
H -->|"Retire"| I["Deprecate, notify users, and shut down"]
Design
Agree on paths, data formats, errors, and security with the people who will use the API.
Describe
Write the specification, including security and quota settings, and validate it.
Deploy the configuration
Upload it to the service. Each upload creates a numbered configuration that you can roll back to.
Deploy the proxy and backend
Start the backend and the proxy, telling the proxy which service name and configuration to use.
Give clients access
Enable the API for the client projects, issue keys or identity access, and share documentation.
Operate
Watch metrics, logs, and quotas, and respond to problems.
Evolve and retire
Release new versions without breaking old ones, announce deprecations early, and switch off old versions when usage ends.
Versioning
Once clients depend on your API, you cannot change it freely. Adding a new optional field is usually safe. Removing a field, changing its meaning, or renaming a path is a breaking change that can crash existing apps. The usual cure is to put a version in the path, such as “v1” and “v2”, run both together for a while, and give users plenty of notice before retiring the old one.
Automation
Treat the specification and deployment steps as code. Keep them in version control, review changes, test against a staging environment, and use a pipeline so that every release follows the same safe steps and can be rolled back to the previous configuration identifier.
9Advantages, Disadvantages, and Trade-offs
An honest view of what you gain and what you give up.
Advantages
- Security, quotas, and monitoring in one place, in front of any service.
- Works with REST and gRPC, and with several Google Cloud platforms.
- Specification-driven, so the contract, rules, and docs agree.
- Small added delay, thanks to caching and batching.
- Built-in dashboards, logs, and traces for each API method.
- Pay-per-use pricing with a free allowance, in the past.
Disadvantages
- You run the proxy yourself, so you manage its scaling, updates, and health.
- Fewer advanced features than full API management platforms, such as rich developer portals, monetisation, and complex policies.
- Historically tied to older specification versions.
- Product direction and recommendations have changed over time.
- An extra hop and component in every request path.
- A bad configuration can block all traffic at once.
The big trade-offs
Central control versus extra moving parts. A front door gives consistent rules, but is one more thing that must be available, secured, and updated.
Self-run proxy versus fully managed gateway. Running the proxy yourself gives flexibility about where it runs, such as beside services on Kubernetes. A managed gateway removes the work of running it, but gives less placement choice.
Light management versus full platform. Cloud Endpoints covers the essentials. A full platform such as Apigee adds portals, analytics products, monetisation, and a large policy library, with more cost and complexity.
Gateway rules versus backend rules. Put generic checks at the front, such as identity, quotas, and basic validation. Keep business rules inside the backend, where the data is.
10Security in Depth
An API is a public-facing entrance to your systems. Guard it in layers.
Layers of protection
Network edge
Use a load balancer, with a web application firewall such as Cloud Armor, rate limits, and DDoS protection, before traffic reaches the proxy.
Transport security
Require encrypted connections everywhere, including between the proxy and the backend where possible.
Authentication at the proxy
Verify tokens and keys on every call, with trusted issuers and exact audiences.
Authorisation in the backend
Decide what each verified user may see or change.
Input validation
Check the size, type, and range of every input, both at the proxy and in the backend.
Logging and alerting
Record access and watch for abuse patterns.
Key practices
- Do not expose the backend directly. The backend should accept calls only from the proxy or gateway, through network rules and identity checks, or attackers will simply go around the front door.
- Restrict API keys. Limit each key to the API it needs and, where possible, to specific apps or addresses, and rotate keys when staff or partners change.
- Use short-lived tokens. Short lifetimes limit the damage of theft.
- Keep secrets out of the specification. The file is reviewed and shared. Store secrets in a secret manager.
- Use least privilege for service accounts. The proxy and the backend each need only the roles for their own work.
- Control who can change the configuration. A changed configuration can open or close your whole API. Restrict and review those permissions.
- Handle cross-origin requests deliberately. If browsers call your API from other sites, allow only the sites you trust.
- Follow common API security guidance. Protect against object-level access mistakes, excessive data exposure, and broken authentication, which are the most frequent API problems.
- Test. Run security tests and reviews before launch and after big changes.
One of the most common API breaches is broken object-level authorisation: a user changes an identifier in the address, such as an order number, and sees someone else’s data. The front door cannot know who owns which order. Your backend must check that the verified user is allowed to access each item.
11Monitoring, Logging, and Tracing
Cloud Endpoints gives you a clear picture of how your API is used and how it behaves.
Endpoints dashboard
Shows requests per second, latency, and error rates for each API and method, and which consumers are calling.
Cloud Logging
A record of each request, with status, latency, size, and the identity or project of the caller.
Cloud Monitoring
Charts and alerts based on request counts, error rates, and latency, and quota use.
Cloud Trace
Samples of requests showing where time was spent, in the proxy or in the backend.
What to watch
- Request rate. Sudden jumps or drops can signal attacks, outages, or broken clients.
- Error rates by status. Many “unauthorised” errors may mean expired tokens or a configuration problem. Many server errors point to the backend.
- Latency. Watch the slowest few percent, and compare proxy time with backend time.
- Quota use by consumer. See who is near their limit, and who is abusing.
- Method popularity. Learn which endpoints are used, and which can be retired.
- Proxy health. Memory, CPU, restarts, and instance counts.
- Configuration changes. Alert when a new configuration is deployed, and who did it.
Troubleshooting flow
When a call fails, ask in order: Did the request reach the proxy, or did the load balancer or network stop it? Did the proxy match the path and method? Did authentication pass? Was the quota exceeded or the service not enabled for that project? Did the backend answer, and how quickly? The logs for the request usually name the step where it stopped.
The reception visitor book shows which visitors came, when, and which department they asked for. When someone complains “my package never arrived”, you check the book first. Was the visitor even logged in? Did the right department receive them? The book shows where the story stopped.
12Performance and Cost Planning
Keep the front door quick and the bill reasonable.
Performance points
- Added delay is small. Caching of checks and batched reporting keep the extra time per call low.
- Size the proxy. It needs enough CPU and memory for your traffic. Use autoscaling where available and set sensible minimum instances.
- Keep the proxy near the backend. Same region, and ideally the same network, to avoid extra delay.
- Set timeouts. Make sure the proxy waits long enough for slow backends and no longer, so resources are freed.
- Use connection reuse. Persistent connections reduce set-up overhead.
- Cache responses where safe. Public, rarely changing data can be cached at the edge with a content delivery network.
- Compress and paginate. Return smaller answers, and break long lists into pages.
What you pay for
Pricing has historically been based on the number of requests, with a free monthly allowance and a price per million requests beyond it. Because pricing and free allowances change, check the current pricing page. You also pay for the compute that runs the proxy and your backend, network traffic, logging, and any load balancers or firewalls.
| Cost area | What it depends on | How to reduce it |
|---|---|---|
| API requests | Number of calls beyond any free allowance | Cache, batch calls, and block junk traffic early |
| Proxy compute | Number and size of proxy instances | Right-size, use autoscaling, and share a gateway where sensible |
| Backend compute | Work done for each request | Optimise code, and use quotas to prevent waste |
| Network | Data moved, especially between regions or out of Google Cloud | Keep services together and compress responses |
| Logging and tracing | Volume of logs and sampled traces | Set retention and sample traces sensibly |
| Edge protection | Load balancer and firewall charges | Use only the rules you need |
13Design Patterns and Anti-patterns
Helpful habits and harmful habits seen again and again in real projects.
Helpful patterns
API facade
Present one clean, stable API to clients while hiding messy or changing backend services behind it. The backend can be reorganised without breaking users.
Design first
Agree the specification before coding. Generate client code, mock servers, and documentation from it.
Version in the path
Use “v1”, “v2” and so on, and run versions side by side during a migration period.
Separate public and internal APIs
Use different configurations, keys, and limits for outside developers and for your own services.
Verified identity passed to the backend
Let the proxy verify tokens and pass the identity along, so the backend focuses on business permissions.
Graceful limits
Return clear errors and wait hints when limits are exceeded, and publish the limits in documentation.
Anti-patterns to avoid
What it looks like
A team puts an API key in a mobile app and treats it as proof that the caller is a trusted user, while the backend is also reachable directly on the internet.
Why it hurts
Anyone can extract the key from the app, and the backend can be called without passing through the front door at all. Rules, limits, and logging are all bypassed.
Better approach
Use tokens to prove identity, use keys only for usage tracking, and make the backend accept calls only from the proxy or gateway.
What it looks like
A team renames fields and changes response formats in the live version of an API, with no notice and no new version.
Why it hurts
Every existing app that depended on the old format breaks at once, and customers lose trust.
Better approach
Add new versions, keep the old ones running for an announced period, and make only backwards-compatible changes inside a version.
More things to steer clear of
- Putting business logic in the gateway. It becomes hard to test and change.
- No quotas at all. One bad client can bring down the service.
- No timeouts. Stuck calls pile up and use all resources.
- Overly chatty APIs. Many tiny calls waste time and money. Offer batch or combined calls.
- Returning too much data. Leaking internal fields creates security and privacy risks.
- Ignoring the proxy’s own health. It is part of your critical path.
14Best Practices and Common Mistakes
A checklist of habits that experienced teams rely on.
Habits that work
- Write the specification first and keep it in version control.
- Require identity with tokens for anything sensitive.
- Restrict API keys and use them for counting usage.
- Set quotas and rate limits and publish them.
- Close the back door. Only the proxy may reach the backend.
- Set timeouts and size limits on every layer.
- Use staging to test each new configuration.
- Roll out gradually and keep the previous configuration ready for rollback.
- Monitor errors, latency, and quotas with alerts.
- Version your API and announce deprecations early.
- Keep secrets in a secret manager, not in specification files.
- Document with examples so developers succeed quickly.
Mistakes beginners often make
| Mistake | What goes wrong | Fix |
|---|---|---|
| Service name does not match the one in the specification | The proxy cannot load its configuration | Use exactly the same service name in the specification and in the proxy settings |
| API not enabled for the client project | Callers receive permission errors | Enable the service for each consuming project |
| Wrong token audience | Valid users are rejected | List the exact audience values your tokens carry |
| Path or method missing from the specification | The proxy returns “not found” for working backend paths | Add every real path and method to the file |
| Backend reachable directly | Rules and logs bypassed | Restrict backend access to the proxy |
| Proxy under-sized | Slow responses and errors during peaks | Increase resources and enable autoscaling |
| Forgetting the proxy has to be redeployed with the new configuration | Changes do not take effect | Deploy the configuration and update the running proxy to use it |
| No quota defaults | Unlimited use by any caller | Define sensible default limits |
15Real-World Usage Examples
Common ways teams use Cloud Endpoints. These are typical scenarios, not claims about any particular company.
Mobile app back end
A food delivery startup exposes its order and menu APIs on Cloud Run. Sign-in tokens are verified at the proxy, and the backend receives the verified user identity. The dashboard shows which API methods are slowest, guiding improvements.
Partner API with quotas
A logistics company offers tracking data to partners. Each partner has a project and key, with different monthly limits. When a partner approaches its limit, the company is alerted and offers a higher plan.
Internal service-to-service APIs
A bank’s microservices on Kubernetes call each other through gRPC with Google ID tokens from service accounts. Only the listed services may call each API, and every call is logged for audit.
Modernising a legacy system
A retailer puts a clean, versioned API in front of an old system. New apps use the new API, while the legacy system is gradually rebuilt behind it, with no change for clients.
Public data API
A government agency publishes open data with API keys for usage counting and generous per-user limits. Charts show which datasets are popular, helping the agency decide what to improve.
Browser applications
A web dashboard calls the API from a browser. Cross-origin rules allow only the company’s own sites, and tokens from the company’s sign-in provider are required on every call.
Staged rollout of a new version
A team deploys a new configuration to a staging environment, runs automated tests, then rolls it out to production. When an error appears, they return to the previous configuration identifier within minutes.
16Choosing the Right API Tool
Google Cloud has several ways to put a front door on an API. Here is how to choose.
flowchart TD
A["You need to manage and protect an API"] --> B{"Need portals, monetisation, analytics products, and rich policies"}
B -->|"Yes"| C["Apigee"]
B -->|"No"| D{"Backend is serverless such as Cloud Run, Functions, or App Engine"}
D -->|"Yes, want a fully managed gateway"| E["API Gateway"]
D -->|"No, runs on GKE or VMs, or you want to run the proxy yourself"| F["Cloud Endpoints with the Extensible Service Proxy"]
A --> G{"Only need load balancing and edge security"}
G -->|"Yes"| H["Cloud Load Balancing with Cloud Armor"]
A --> I{"Need service to service traffic control inside a mesh"}
I -->|"Yes"| J["Service mesh tools"]
| Tool | Best for | Remember |
|---|---|---|
| Cloud Endpoints | Specification-driven API management with a proxy you run next to or in front of your service | You manage the proxy. Good for Kubernetes, virtual machines, and Cloud Run. |
| API Gateway | A fully managed gateway for serverless back ends | Built on the same technology, with less to operate |
| Apigee | Full-scale API programmes with developer portals, analytics, and monetisation | More power, more cost, more to learn |
| Cloud Load Balancing and Cloud Armor | Spreading traffic and blocking attacks at the edge | Does not understand your API contract or per-consumer quotas |
| Service mesh tools | Traffic and security between your own services | Focused on internal traffic more than external developers |
| Open-source gateways | Portable setups that run anywhere | You operate and secure them yourself |
A simple rule of thumb: use a managed gateway when you want the least work and your backends are serverless. Use Cloud Endpoints when you want to run the proxy yourself next to services on Kubernetes or virtual machines. Use a full platform when you run an API business with partners and developer communities. Because Google’s guidance changes, check the current recommendation, especially for new projects.
17Frequently Asked Questions
18A Starter Plan
Here is a calm, step-by-step plan for your first protected API.
Pick the right tool
Check the current guidance. Choose between Cloud Endpoints, API Gateway, and a larger platform, based on where your backend runs and how much you want to operate.
Write a small specification
Start with two or three paths. Add the host name, the backend address, and one security method.
Deploy to a test project
Deploy the configuration, the backend, and the proxy in a separate project, and call the API with a client tool.
Add identity and a quota
Require a token for private paths, an API key for usage counting, and a modest default quota.
Close the back door
Make sure the backend is reachable only from the proxy.
Add monitoring and alerts
Create alerts for error rate, latency, and quota use, and look at the dashboard after a day of testing.
Go live gradually
Deploy to production, send a small share of real traffic first, and keep the previous configuration identifier ready for rollback.
19Summary and Key Takeaways
What to remember
- Cloud Endpoints is an API management front door. A proxy in front of your service checks identity, applies quotas, forwards good calls, and reports every request, so your backend can focus on business logic.
- The specification is the heart. Describe REST APIs with OpenAPI or gRPC services with protocol buffers, and keep security, backend routing, and quota rules next to the contract, in version control.
- Keys count, tokens prove. Use API keys to identify projects and apply quotas, use signed tokens or service account ID tokens for real identity, and make the backend decide what each identity may do.
- Limit and protect. Define quotas and rate limits, set timeouts, combine with a firewall and edge protection, and never leave the backend reachable around the front door.
- Operate with care. Version your API, make only compatible changes inside a version, deploy configurations gradually with rollback ready, and watch errors, latency, and quota use with alerts.
- Know the trade-offs. You run the proxy yourself, and it offers fewer advanced features than a full platform, so compare it with API Gateway and Apigee for your needs.
- Check the latest guidance. Google’s recommendations, supported specification versions, limits, and pricing have changed over time, so confirm them in the official documentation before starting a new project.