API Management on Google Cloud: Apigee, API Gateway, Cloud Endpoints and Designing Secure APIs

Google Cloud Platform Architect 50 min min read Updated: Nov 17, 2026 Intermediate
API Management on Google Cloud: Apigee, API Gateway, Cloud Endpoints and Designing Secure APIs
Intermediate Topic 2 of 3

Why Manage APIs?

  • APIs are how apps, partners and mobile clients use your services
  • You need security, rate limits, analytics, versioning, developer onboarding and transformation in one place
  • An API gateway or management layer keeps backends simple

The Options

ProductBest for
ApigeeFull enterprise API management: policies, analytics, developer portal, monetization, hybrid and multi-cloud
API GatewaySimple managed gateway for Cloud Run, Cloud Functions and App Engine backends (OpenAPI-based)
Cloud EndpointsLightweight API management with ESP/ESPv2 proxy (OpenAPI and gRPC)
Application Load Balancer + IAP + Cloud ArmorProtect internal and web apps
Cloud Service MeshService-to-service traffic management inside GKE or VMs

Apigee Concepts

ConceptMeaning
API proxyA facade in front of your backend that applies policies
PoliciesReusable steps: verify API key, OAuth, Spike Arrest, Quota, transform, cache, threat protection, JSON-to-XML
API productA bundle of APIs with quota and access rules offered to developers
Developer, app and keyWho uses your API, with credentials
Environments and organizationsDev, test, prod separation
Analytics and monitoringTraffic, errors, latency, top apps
Developer portalDocumentation and self-service signup
MonetizationCharge for API use
xml <!-- An Apigee proxy flow snippet: check the key, then limit requests --> <ProxyEndpoint name="default"> <PreFlow name="PreFlow"> <Request> <Step><Name>VerifyAPIKey</Name></Step> <Step><Name>SpikeArrest</Name></Step> <Step><Name>Quota</Name></Step> </Request> </PreFlow> <HTTPProxyConnection><BasePath>/v1/orders</BasePath></HTTPProxyConnection> <RouteRule name="default"><TargetEndpoint>orders-backend</TargetEndpoint></RouteRule> </ProxyEndpoint>

API Gateway Example

yaml swagger: '2.0' info: {title: Orders API, version: 1.0.0} schemes: [https] produces: [application/json] paths: /orders: get: operationId: listOrders x-google-backend: {address: https://orders-abc-uc.a.run.app} security: [{api_key: []}] responses: {'200': {description: OK}} securityDefinitions: api_key: {type: apiKey, name: key, in: query}
bash gcloud api-gateway api-configs create orders-v1 --api=orders-api --openapi-spec=openapi.yaml --backend-auth-service-account=orders-sa@my-proj.iam.gserviceaccount.com gcloud api-gateway gateways create orders-gw --api=orders-api --api-config=orders-v1 --location=asia-northeast1

Authentication Choices

MethodUse
API keyIdentify an app, not secure on its own
OAuth 2.0 / JWT (OIDC)User or app identity with tokens
Google ID tokens / service accountsService-to-service calls on Google Cloud
Mutual TLSHigh-trust partner connections
IAPEmployee access to internal apps

API Design Best Practices

  1. Use clear resource names: /orders/42 not /getOrder
  2. Use the right HTTP methods and status codes
  3. Version the API (/v1) and avoid breaking changes
  4. Support pagination, filtering and idempotent retries
  5. Return consistent error messages
  6. Always use HTTPS, validate input, apply rate limits
  7. Publish an OpenAPI description and examples
  8. Use gRPC for fast internal service calls

Practice

  1. Deploy a Cloud Run service and put API Gateway in front
  2. Add an API key requirement
  3. Design the URLs and methods for a library API (books, members, loans)
  4. Explain when to choose Apigee instead of API Gateway

Conclusion

API Gateway fits simple serverless backends, Cloud Endpoints is a lightweight option and Apigee is the full management platform with policies, quotas, analytics and monetization. Secure APIs with strong authentication and design them cleanly.

Quick Summary: why; options; Apigee; API Gateway; authentication; design.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators