Skip to content

[FEATURE]: Vertex AI route for the Google Interactions protocol #54162

Closed

Description

@sergiopadure

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The Google Interactions protocol from #52981 can only reach the Gemini API. Could you add a Vertex AI route for it, in
the same way the google-vertex provider already has Gemini, Messages and Responses routes? Teams that use Gemini only
through Vertex AI cannot use the new protocol today.

Current state on v2 (5cfe3b4)

  • packages/ai/src/protocols/google-interactions.ts has one base URL:
    https://generativelanguage.googleapis.com/v1beta.
  • packages/ai/src/providers/google/interactions.ts accepts apiKey and baseURL, and providers/google.ts sends the
    key as x-goog-api-key. There is no project, location or OAuth option, so a service account or Application
    Default Credentials cannot be used. A static Authorization header is not practical because the token expires.
  • packages/ai/src/providers/google-vertex.ts already builds the project and location URL and the OAuth token for the
    Gemini route, so the pieces exist.

Vertex endpoint (Preview; the documented project endpoint uses locations/global):
POST https://aiplatform.googleapis.com/v1beta1/projects/{project}/locations/global/interactions, with ADC or an
express-mode API key.
Developer guide
and API reference.

What we checked on Vertex (2026-10-09, gemini-3.8-flash, service account through ADC, called directly):

  • Non-streaming and ?alt=sse streaming both return 200. The stream sends interaction.created,
    interaction.status_update, step.start, step.delta, step.stop, interaction.completed and done.
  • service_tier: "flex" in the body and the x-vertex-ai-llm-shared-request-type: flex header (which the Vertex Gemini
    route sends) are both accepted. The response does not say which tier ran, so it is worth confirming which one Vertex
    uses.

Not requested: automatic continuation. On the same endpoint we compared full-history replay with
previous_interaction_id, over 5 turns with a 12.7K-token system instruction:

Mode Input tokens Cached tokens
store: false, full history (current default) 63,782 32,605
store: true, previous_interaction_id, only the new turn 63,782 0

Continuation billed the same input tokens and got no implicit cache hits in this test. The system instruction must
also be sent on every turn: when we sent it on turn 1 only, later answers were wrong. So the current store: false
default looks right for Vertex, and we are not asking for automatic continuation.

Activity

  1. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed request and the Vertex test results! To restate it: you'd like a Vertex AI route for the Google Interactions protocol, so it can be used with a project and location and with ADC/service-account auth (or an express-mode API key). That would match the Gemini, Messages and Responses routes that google-vertex already has.

    I checked v2 and it matches what you describe. protocols/google-interactions.ts only targets generativelanguage.googleapis.com/v1beta, and providers/google/interactions.ts only takes apiKey/baseURL. The project/location and OAuth handling in google-vertex.ts looks like it could be reused. Your notes on keeping the store: false full-history default and on confirming which flex tier Vertex applies are helpful too.

    Related:

    The maintainers will look at this as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions