Skip to main content

Vertex AI Agent Engine

Vertex AI Agent Engine is available on the Spanway gateway through the vertex_ai/ model prefix. You register a Vertex AI Agent Engine model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

The gateway translates requests and responses for Vertex AI Agent Engine natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Environment variables​

The Vertex AI Agent Engine integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
VERTEXAI_PROJECTYesProject the requests are billed to
VERTEXAI_LOCATIONYesRegion or location of the deployment
VERTEX_PROJECTNoProject the requests are billed to
VERTEX_LOCATIONNoRegion or location of the deployment
VERTEXAI_CREDENTIALSNoAlternative credential source
VERTEX_CREDENTIALSNoAlternative credential source
VERTEXAI_API_BASENoOverrides the provider base URL
VERTEX_API_BASENoOverrides the provider base URL
GOOGLE_APPLICATION_CREDENTIALSNoAlternative credential source
GCS_BUCKET_NAMENoStorage bucket used by file and batch operations
GCS_BATCH_BUCKET_NAMENoStorage bucket used by file and batch operations
GCS_PATH_SERVICE_ACCOUNTNoRead by the provider integration

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Pricing​

The price map bundled with this Spanway build has no entries for Vertex AI Agent Engine. Without a price the gateway still serves and logs requests, but it cannot compute their cost. Add input_cost_per_token and output_cost_per_token to the deployment to enable spend tracking, as described in custom pricing.