X

apigee-samples

Information

# Apigee Samples - [Apigee Samples](#apigee-samples) - [Intro](#intro) - [Audience](#audience) - [Before you begin](#before-you-begin) - [Using the sample proxies](#using-the-sample-proxies) - [Samples](#samples) - [Samples for LLM Serving with Apigee](#samples-for-llm-serving-with-apigee) - [ADK Samples with Apigee](#adk-samples-with-apigee) - [Prerequisites](#prerequisites) - [Samples](#samples-1) - [Apigee and Model Context Protocol (MCP)](#apigee-and-model-context-protocol-mcp) - [Apigee API hub plugins](#apigee-api-hub-plugins) - [Modifying a sample proxy](#modifying-a-sample-proxy) - [Ask questions on the Community Forum](#ask-questions-on-the-community-forum) - [Apigee documentation](#apigee-documentation) - [Contributing](#contributing) - [License](#license) - [Not Google Product Clause](#not-google-product-clause) - [Support](#support) --- ## Intro This repository contains a collection of sample API proxies that you can deploy and run on Apigee X or [hybrid](https://cloud.google.com/apigee/docs/hybrid/latest/what-is-hybrid). The samples provide a jump-start for developers who wish to design and create Apigee API proxies. ### Audience You are an [Apigee](https://cloud.google.com/apigee) API proxy developer, or you would like to learn about developing APIs that run on Apigee X & hybrid. At a minimum, we assume you're familiar with Apigee and how to create simple API proxies. To learn more, we recommend this [getting started tutorial](https://cloud.google.com/apigee/docs/api-platform/get-started/get-started). ## Before you begin 1. See the full list of [Prerequisites](https://cloud.google.com/apigee/docs/api-platform/get-started/prerequisites) for installing Apigee. 2. You'll need access to a Google Cloud Platform account and project. [Sign up for a free GCP trial account.](https://console.cloud.google.com/freetrial) 3. If you don't have one, you'll need to provision an Apigee instance. [Create a free Apigee eval instance.](https://apigee.google.com/setup/eval) 4. Clone this project from GitHub to your system. ## Using the sample proxies Most developers begin by identifying an interesting sample based on a specific use case or need. You'll find all the samples in the root folder. ### Samples | | Sample | Description | Cloud Shell Tutorial | | --- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | [deploy-apigee-proxy](deploy-apigee-proxy) | Deploy Apigee proxy using Apigee Maven plugin and Cloud Build | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=deploy-apigee-proxy/docs/cloudshell-tutorial-maven.md) | | 2 | [deploy-apigee-sharedflow](deploy-apigee-sharedflow) | Deploy Apigee sharedflow using Apigee Maven plugin and Cloud Build | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=deploy-apigee-sharedflow/docs/cloudshell-tutorial-maven.md) | | 3 | [deploy-apigee-config](deploy-apigee-config) | Deploy Apigee configurations using Apigee Maven plugin and Cloud Build | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=deploy-apigee-config/docs/cloudshell-tutorial-maven.md) | | 4 | [authorize-idp-access-tokens](authorize-idp-access-tokens) | Authorize JWT access tokens issued by an Identity Provider | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=authorize-idp-access-tokens/docs/cloudshell-tutorial.md) | | 5 | [oauth-client-credentials](oauth-client-credentials) | A sample proxy which uses the OAuth 2.0 client credentials grant type flow | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=oauth-client-credentials/docs/cloudshell-tutorial.md) | | 6 | [oauth-client-credentials-with-scope](oauth-client-credentials-with-scope) | A sample proxy which uses the OAuth 2.0 client credentials grant type flow and limit access using [OAuth2 scopes](https://cloud.google.com/apigee/docs/api-platform/security/oauth/working-scopes) | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=oauth-client-credentials-with-scope/docs/cloudshell-tutorial.md) | | 7 | [cloud-logging](cloud-logging) | A sample proxy that logs custom messages to Google Cloud Logging | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=cloud-logging/docs/cloudshell-tutorial.md) | | 8 | [basic-caching](basic-caching) | An example showing how to cache responses and other data using Apigee's built in policies | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=basic-caching/docs/cloudshell-tutorial.md) | | 9 | [basic-quota](basic-quota) | A sample which shows how to implement a basic API consumption quota | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=basic-quota/docs/cloudshell-tutorial.md) | | 10 | [apiproduct-operations](apiproduct-operations) | Shows the behavior of API Product Operations | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=apiproduct-operations/docs/cloudshell-tutorial.md) | | 11 | [cloud-run](cloud-run) | A sample proxy to invoke Cloud Run Service from Apigee | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=cloud-run/docs/cloudshell-tutorial.md) | | 12 | [integrated-developer-portal](integrated-developer-portal) | This sample demonstrates how to create an Apigee Integrated portal and shows how to expose your API products to its catalog | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=integrated-developer-portal/docs/cloudshell-tutorial.md) | | 13 | [drupal-developer-portal](drupal-developer-portal) | This sample demonstrates how to create a Drupal developer portal using the GCP Marketplace and shows how to expose your Apigee API products to its catalog | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=drupal-developer-portal/docs/cloudshell-tutorial.md) | | 14 | [exposing-to-internet](exposing-to-internet) | This sample demonstrates how to expose an Apigee instance to the internet using a Google Cloud external HTTP(S) Load Balancer | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=exposing-to-internet/docs/cloudshell-tutorial.md) | | 15 | [json-web-tokens](json-web-tokens) | This sample demonstrates how to generate and verify JSON Web Tokens using the out of the box Apigee JWT policies | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=json-web-tokens/docs/cloudshell-tutorial.md) | | 16 | [cors](cors) | This sample lets you create an API that uses the cross-origin resource sharing (CORS) mechanism to allow requests from external webpages and applications | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=cors/docs/cloudshell-tutorial.md) | | 17 | [extract-variables](extract-variables) | This sample demonstrates how to extract variables and set headers using the out of the box Apigee AssignMessage and ExtractVariable policies | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=extract-variables/docs/cloudshell-tutorial.md) | | 18 | [websockets](websockets) | This sample shows how to deploy a sample websockets echo server in Cloud Run and how to use Apigee to expose that service to developers securely | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=websockets/docs/cloudshell-tutorial.md) | | 19 | [grpc](grpc) | This sample shows how to deploy a sample gRPC Hello World application in Cloud Run and how to use Apigee to expose that service to developers securely | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=grpc/docs/cloudshell-tutorial.md) | | 20 | [mtls-northbound](mtls-northbound) | This sample shows how to configure mTLS using a GCP Private CA (Certificate Authority) on an existing GLB (global load balancer). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=mtls-northbound/docs/cloudshell-tutorial.md) | | 21 | [property-set](property-set) | This sample lets you create an API that uses a property set and shows how to get data from it using a mediation policy (AssignMessage). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=property-set/docs/cloudshell-tutorial.md) | | 22 | [data-deidentification](data-deidentification) | Invokes the Data Loss Prevention (DLP) API to perform data masking (de-identification) on JSON and XML payloads. | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=data-deidentification/docs/cloudshell-tutorial.md) | | 23 | [publish-to-apigee-portal](publish-to-apigee-portal) | Publish OpenAPI Spec to Apigee Integrated Portal using Maven plugin and Cloud Build | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=publish-to-apigee-portal/docs/cloudshell-tutorial.md) | | 24 | [threat-protection](threat-protection) | Threat Protection sample in Apigee | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=threat-protection/docs/cloudshell-tutorial.md) | | 25 | [composite-api](composite-api) | Composite API sample in Apigee | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=composite-api/docs/cloudshell-tutorial.md) | | 26 | [cloud-functions](cloud-functions) | A sample proxy that connects to an app running in Cloud Functions | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=cloud-functions/docs/cloudshell-tutorial.md) | | 27 | [grpc-web](grpc-web) | A sample proxy that connects to a gRPC-Web service running in Cloud Run | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=grpc-web/docs/cloudshell-tutorial.md) | | 28 | [monolith-to-microservices-based-on-paths](monolith-to-microservices-based-on-paths) | Sample facade to facilitate the migration from a monolith to a microservice architecture. | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=monolith-to-microservices-based-on-paths/docs/cloudshell-tutorial.md) | | 29 | [extension-processor-http](extension-processor-http) | This sample demonstrates how to use [Apigee API Management](https://cloud.google.com/apigee/docs/api-platform/get-started/what-apigee) with Google Cloud Load Balancer [Service Extensions](https://cloud.google.com/service-extensions/docs/overview). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=extension-processor-http/docs/cloudshell-tutorial.md) | | 30 | [extension-processor-grpc](extension-processor-grpc) | This sample demonstrates how to use [Apigee API Management](https://cloud.google.com/apigee/docs/api-platform/get-started/what-apigee) with Google Cloud Load Balancer [Service Extensions](https://cloud.google.com/service-extensions/docs/overview). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=extension-processor-grpc/docs/cloudshell-tutorial.md) | | 31 | [java-callout](java-callout) | This sample demonstrates how to use the [Java Callout policy](https://cloud.google.com/apigee/docs/api-platform/reference/policies/java-callout-policy). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=java-callout/docs/cloudshell-tutorial.md) | | 31 | [mtls-southbound](mtls-southbound) | This sample shows an mTLS southbound backend connection using an [Apigee Keystore and Truststore](https://cloud.google.com/apigee/docs/api-platform/system-administration/options-configuring-tls). | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=mtls-southbound/docs/cloudshell-tutorial.md) | | 32 | [apihub-portal-publish](apihub-portal-publish) | Shows how an unmanaged API can be onboarded to Apigee API hub, deployed as a managed Apigee proxy for secure access, and then published to the Apigee integrated developer portal. | [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/apigee-samples&cloudshell_git_branch=main&cloudshell_workspace=.&cloudshell_tutorial=apihub-portal-publish/docs/cloudshell-tutorial.md) | You can find video walkthroughs of many of these samples in this [YouTube playlist](https://goo.gle/ApigeeAcceleratorSeries) ## Samples for LLM Serving with Apigee The rise of Large Language Models (LLMs) presents an unparalleled opportunity for AI productization, but also necessitates a robust platform to manage, scale, secure, and govern access to them. While specialized tools and platforms are emerging, organizations can leverage their existing investment in a best-in-class API Management platform like Apigee to effectively handle all their LLM serving needs. Apigee X plays a crucial role in LLM serving by acting as an intermediary between clients and the LLM endpoints. It provides a secure, reliable, and scalable way to expose LLMs as APIs while offering essential features like: - **Security:** Authentication, authorization, rate limiting, and protection against attacks. - **Reliability:** Load balancing, circuit breaking, and failover mechanisms. - **Performance:** Caching, request/response transformation, and optimized routing. - **Observability:** Logging, monitoring, and tracing for troubleshooting and analysis. - **Governance:** API lifecycle management, versioning, and productization. This repository explores common LLM serving patterns using Apigee X as a robust and feature-rich API management platform. While the primary focus is on serving Gemini models, the principles and patterns discussed here can be adapted for other LLMs. | | Sample | Description | Open Notebook | | --- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | [llm-token-limits](llm-token-limits) | Apigee's API Products provide real-time monitoring and enforcement of token usage limits for LLMs, enabling effective management of token consumption across different providers and consumers. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-token-limits/llm_token_limits.ipynb) | | 2 | [llm-semantic-cache](llm-semantic-cache) | This sample performs a cache lookup of responses on Apigee's Cache layer and Vector Search as an embeddings database. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-semantic-cache/llm_semantic_cache_v1.ipynb) | | 3 | [llm-semantic-cache-v2](llm-semantic-cache-v2) | This sample performs a cache lookup of responses on Apigee's Cache layer and Vector Search as an embeddings database using out of the box policies. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-semantic-cache-v2/llm_semantic_cache_v2.ipynb) | | 4 | [llm-circuit-breaking](llm-circuit-breaking) | Apigee enhances the resilience and prevents outages in Retrieval Augmented Generation applications that utilize multiple Large Language Models by intelligently managing traffic and implementing circuit breaking to avoid exceeding endpoint quotas. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-circuit-breaking/llm_circuit_breaking.ipynb) | | 5 | [llm-logging](llm-logging) | Logging prompts and responses of large language models facilitates performance analysis, security monitoring, and bias detection, ultimately enabling model improvement and risk mitigation. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-logging/llm_logging_v1.ipynb) | | 6 | [llm-routing](llm-routing) | Sample to route to different LLM providers using Apigee's routing capabilities. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-routing/llm_routing_v1.ipynb) | | 7 | [llm-security](llm-security) | Sample to demonstrate the security capabilities of Apigee with Model Armor to secure the user prompts | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-security/llm_security_v1.ipynb) | | 8 | [llm-security-v2](llm-security-v2) | Sample to demonstrate the security capabilities of Apigee with out of the box Model Armor policies to secure the user prompts | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-security-v2/llm_security_v2.ipynb) | | 9 | [llm-vertexai-agent](llm-vertexai-agent) | Sample to deploy an agent using Vertex Agent Builder and point to an Apigee proxy | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-vertexai-agent/llm_vertexai_agent.ipynb) | | 10 | [llm-function-calling](llm-function-calling) | Sample to deploy a proxy and configure it as a function call | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-function-calling/llm_function_calling.ipynb) | | 11 | [llm-sse-security](llm-sse-security) | Sample to deploy a proxy that streams server-side events (SSE) and use Model Armor to inspect the response | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-sse-security/llm_sse_security_v1.ipynb) | | 12 | [llm-sse-logging](llm-sse-logging) | Sample to deploy a proxy that streams server-side events (SSE) and log the response to Cloud Logging | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-sse-logging/llm_sse_logging_v1.ipynb) | | 13 | [llm-token-limits-per-user](llm-token-limits-per-user) | Apigee's API Products provide real-time monitoring and enforcement of token usage limits for LLMs, enabling effective management of token consumption across different providers and consumers. This focus on per end-user counting | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./llm-token-limits-per-user/llm_token_limits_per_user.ipynb) | ## ADK Samples with Apigee This is a collection of sample AI agents created using Google's [Agent Development Kit](https://google.github.io/adk-docs/) that show how to use ADK's built-in tooling to connect to APIs from [Apigee API hub](https://cloud.google.com/apigee/docs/apihub/what-is-api-hub). ### Prerequisites You will need a GCP project with the following services enabled and provisioned: - Vertex AI - Apigee API hub - Apigee ### Samples | Agent | Description | | ---------------------------------------------------- | ----------------------------------------------------------------------------------------- | | [adk-auto-insurance-agent](adk-auto-insurance-agent) | A virtual assistant for auto insurance that uses Apigee API hub to provide APIs as tools. | For more information on ADK's Apigee API hub and Application Integration toolsets, see the [documentation](https://google.github.io/adk-docs/tools/google-cloud-tools/). ## Apigee and Model Context Protocol (MCP) The [Model Context Protocol (MCP)](https://github.com/modelcontext/specification) standardizes how Large Language Models (LLMs) interact with external tools and APIs. Apigee can act as a powerful MCP provider, exposing managed APIs as tools for LLMs. This allows AI agents to leverage existing enterprise APIs securely and reliably through Apigee's governance and traffic management capabilities. The sample in this section demonstrates how to integrate Apigee with MCP. | | Sample | Description | Open Notebook | | --- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | [apigee-mcp](apigee-mcp) | Illustrates Apigee's role in the MCP ecosystem. Features an MCP server that discovers API specs from Apigee API hub, dynamically creates tools for LLMs, and exposes them through Apigee. An example CRM agent notebook demonstrates consuming these tools. | [![notebook](https://github.com/GoogleCloudPlatform/apigee-samples/blob/main/images/icon32.png?raw=true)](./apigee-mcp/notebooks/crm-agent-mcp.ipynb) | ## Apigee API hub plugins Plugins, also known as *on-ramp plugins*, enable API hub to connect and ingest API metadata from various Google Cloud services and external sources where your APIs are managed or defined. They simplify and enhance the process of bringing your API metadata directly into API hub. For more info on plugins, check out this [page](https://cloud.google.com/apigee/docs/apihub/plugins). The sample in this section demonstrates how to configure them for different sources. | | Sample | Description | | --- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | [azure-apim](./apihub-plugins/azure-apim) | This sample provides an Application Integration template and scripts to synchronize API metadata from Azure API Management (APIM) to Apigee API hub | ## Modifying a sample proxy Feel free to modify and build upon the sample proxies. You can make changes in the Apigee [management UI](https://cloud.google.com/apigee/docs/api-platform/develop/ui-edit-proxy) or by using our Cloud Code [extension for local development](https://cloud.google.com/apigee/docs/api-platform/local-development/setup) in Visual Studio Code. Whichever approach is comfortable for you. Simply redeploy the proxies for changes to take effect. ## Ask questions on the Community Forum [The Apigee Forum](https://www.googlecloudcommunity.com/gc/Apigee/bd-p/cloud-apigee) on the [Google Cloud Community site](https://www.googlecloudcommunity.com/) is a great place to ask questions and find answers about developing API proxies. ## Apigee documentation The Apigee docs are located [here](https://cloud.google.com/apigee/docs). ## Contributing New samples should be added as a root level directory in this repository. For more details on how to contribute please see the [guidelines](./CONTRIBUTING.md). ## License All solutions within this repository are provided under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. Please see the [LICENSE](./LICENSE.txt) file for more detailed terms and conditions. ## Not Google Product Clause This is not an officially supported Google product, nor is it part of an official Google product. ## Support If you need support or assistance, you can try inquiring on [Google Cloud Community forum dedicated to Apigee](https://www.googlecloudcommunity.com/gc/Apigee/bd-p/cloud-apigee).

Prompts

Reviews

Tags

Write Your Review

Detailed Ratings

ALL
Correctness
Helpfulness
Interesting
Upload Pictures and Videos

Name
Size
Type
Download
Last Modified
  • Community

Add Discussion

Upload Pictures and Videos