# Proxy Gemini Enterprise Agent Platform Requests

[Gemini Enterprise Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models) is the current name for the Google Cloud model platform previously documented as Vertex AI. It provides access to Gemini and partner models, including an OpenAI-compatible Chat Completions API.

This guide configures the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin for Agent Platform. The released APISIX provider identifier remains `vertex-ai`. This guide sets the documented global Chat Completions URL through `override.endpoint` because the released driver derives only regional host names from `provider_conf.region`.

## Prerequisite(s)[​](#prerequisites "Direct link to Prerequisite(s)")

* Install [Docker](https://docs.docker.com/get-docker/).
* Install [cURL](https://curl.se/) to send requests to the services for validation.
* Install [`jq`](https://jqlang.org/download/) to encode the service-account key for the Admin API request.
* Follow the [Getting Started Tutorial](https://docs.api7.ai/apisix/getting-started.md) to start a new APISIX instance in Docker or on Kubernetes.
* Have a Google Cloud project with billing and the [Agent Platform API enabled](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com).
* If you use the Admin API examples and authentication is enabled, export an admin-role key as `ADMIN_API_KEY`. Configure the key under `deployment.admin.admin_key`. The Docker quickstart disables authentication for local evaluation; keep it enabled in production.

## Obtain an Agent Platform Service Account Key[​](#obtain-an-agent-platform-service-account-key "Direct link to Obtain an Agent Platform Service Account Key")

Create a service account, grant it the Agent Platform User (`roles/aiplatform.user`) role, and [create a JSON service-account key](https://docs.cloud.google.com/iam/docs/keys-create-delete). The plugin requires the downloaded key because it does not discover Application Default Credentials or Workload Identity Federation credentials.

Save the raw key for ADC and a JSON-encoded string for the Admin API request:

```
export GCP_SERVICE_ACCOUNT_JSON="$(cat /path/to/service-account.json)"

export GCP_SERVICE_ACCOUNT_JSON_STRING="$(jq -Rs . < /path/to/service-account.json)"
```

## Create a Route to Agent Platform[​](#create-a-route-to-agent-platform "Direct link to Create a Route to Agent Platform")

Create a route with the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin as such:

* Admin API
* ADC

```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \

  -H "X-API-KEY: ${ADMIN_API_KEY}" \

  --data-binary @- <<EOF

{

  "id": "vertex-ai-chat",

  "uri": "/anything",

  "plugins": {

    "ai-proxy": {

      "provider": "vertex-ai",

      "override": {

        "endpoint": "https://aiplatform.googleapis.com/v1beta1/projects/<GCP_PROJECT_ID>/locations/global/endpoints/openapi/chat/completions"

      },

      "auth": {

        "gcp": {

          "service_account_json": $GCP_SERVICE_ACCOUNT_JSON_STRING

        }

      },

      "options": {

        "model": "google/gemini-3.5-flash"

      }

    }

  }

}

EOF
```

❶ Set the provider to `vertex-ai` and override its endpoint with the documented global Chat Completions URL. Replace `<GCP_PROJECT_ID>` with your project ID.

❷ Replace with your service account JSON.

❸ Set an Agent Platform model that supports Chat Completions on the global endpoint. This example uses `google/gemini-3.5-flash`, which supports the default Standard PayGo consumption mode on `global`.

adc.yaml

```
services:

  - name: Agent Platform Service

    routes:

      - uris:

          - /anything

        name: vertex-ai-chat

        plugins:

          ai-proxy:

            provider: vertex-ai

            override:

              endpoint: https://aiplatform.googleapis.com/v1beta1/projects/<GCP_PROJECT_ID>/locations/global/endpoints/openapi/chat/completions

            auth:

              gcp:

                service_account_json: ${GCP_SERVICE_ACCOUNT_JSON}

            options:

              model: google/gemini-3.5-flash
```

❶ Set the provider to `vertex-ai` and override its endpoint with the documented global Chat Completions URL. Replace `<GCP_PROJECT_ID>` with your project ID.

❷ Replace with your service account JSON.

❸ Set an Agent Platform model that supports Chat Completions on the global endpoint. This example uses `google/gemini-3.5-flash`, which supports the default Standard PayGo consumption mode on `global`.

Preview the service change. These options compare only this tutorial's service, so other gateway resources stay unchanged:

```
adc diff -f adc.yaml \

  --include-resource-type service \

  --label-selector docs-example=vertex-ai
```

Review `diff.yaml` and confirm that it contains only the intended service and route changes. Then synchronize the reviewed configuration with the same scope:

```
adc sync -f adc.yaml \

  --include-resource-type service \

  --label-selector docs-example=vertex-ai
```

## Verify[​](#verify "Direct link to Verify")

Send a request with the following prompts to the route:

```
curl "http://127.0.0.1:9080/anything" -X POST \

  -H "Content-Type: application/json" \

  -d '{

    "messages": [

      { "role": "system", "content": "You are a mathematician" },

      { "role": "user", "content": "What is 1+1?" }

    ]

  }'
```

You should receive a response similar to the following:

```
{

  "choices": [

    {

      "message": {

        "role": "assistant",

        "content": "1 + 1 = 2\n"

      },

      "index": 0,

      "logprobs": null,

      "finish_reason": "stop"

    }

  ],

  "usage": {

    "completion_tokens": 8,

    "extra_properties": {

      "google": {

        "traffic_type": "ON_DEMAND"

      }

    },

    "total_tokens": 19,

    "prompt_tokens": 11

  },

  "object": "chat.completion",

  "model": "google/gemini-3.5-flash",

  ...

}
```

## Next Steps[​](#next-steps "Direct link to Next Steps")

You have connected APISIX to Gemini Enterprise Agent Platform. See the [Agent Platform model catalog](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/google-models) and [OpenAI-compatible Chat Completions documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate/openai/overview) for supported models and request fields.
