SpyBara
Go Premium

guides/google-cloud.md 2026-11-05 23:00 UTC to 2026-11-06 23:00 UTC

This page contains 365 additions and 0 deletions.

2026
Fri 6 23:00 Fri 13 23:58

OpenAI on Google Cloud

For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.

Access to OpenAI models through Google Cloud is currently in private preview. To use them in your project, request access.

OpenAI models are available on the Gemini platform through Google Cloud, with usage billed to your Google Cloud account. The models run within Google Cloud’s security perimeter, and your organization manages access through Google Cloud IAM.

This guide covers how to make a Responses API request through Google Cloud and how feature support differs from the first-party OpenAI API.

The following models are available:

Model Model ID
GPT-6 Luna gpt-6-luna
GPT-6.1 Sol gpt-6.1-sol
GPT-6.1 Terra gpt-6.1-terra
GPT-6 Astra gpt-6-astra

Before you begin

Before you can make requests, your Google Cloud administrator needs to:

  • Enable billing for the project, arrange project approval, and coordinate acceptance of the Marketplace private offer with your billing administrator.
  • Enable the Vertex AI API (aiplatform.googleapis.com) and the model in Model Garden, including acceptance of the model terms.
  • If your organization’s policy restricts model access, allow the model in that policy.
  • Grant the user or service account making requests permission to call the model, for example by assigning the roles/aiplatform.user role.

Once the project is ready, ask your administrator for the project ID.

Make your first API call

For local development, install the Google Cloud CLI and sign in with the Google account that has access to your project:

gcloud auth application-default login

Get an access token in the terminal where you’ll run the request:

export GOOGLE_CLOUD_ACCESS_TOKEN="$(gcloud auth application-default print-access-token)"

When the access token expires, run this command again to get a new one using your saved sign-in.

Send the request with cURL or the OpenAI SDK, replacing your-project-id with your project ID.

Responses API request on Google Cloud

PROJECT_ID="your-project-id"
PROJECT_URL="https://aiplatform.googleapis.com/v1/projects/$PROJECT_ID"

curl --fail-with-body "$PROJECT_URL/locations/global/publishers/openai/v1/responses" \
  -H "Authorization: Bearer $GOOGLE_CLOUD_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "input": "Write a one-sentence bedtime story about a unicorn.",
    "store": false
  }'
import OpenAI from "openai";

const projectId = "your-project-id";

const client = new OpenAI({
  apiKey: process.env.GOOGLE_CLOUD_ACCESS_TOKEN,
  baseURL: `https://aiplatform.googleapis.com/v1/projects/${projectId}/locations/global/publishers/openai/v1`,
});

const response = await client.responses.create({
  model: "gpt-6-luna",
  input: "Write a one-sentence bedtime story about a unicorn.",
  store: false,
});

console.log(response.output_text);
import os

from openai import OpenAI

project_id = "your-project-id"

client = OpenAI(
    api_key=os.environ["GOOGLE_CLOUD_ACCESS_TOKEN"],
    base_url=(
        f"https://aiplatform.googleapis.com/v1/projects/{project_id}"
        "/locations/global/publishers/openai/v1"
    ),
)
response = client.responses.create(
    model="gpt-6-luna",
    input="Write a one-sentence bedtime story about a unicorn.",
    store=False,
)
print(response.output_text)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/openai/openai-go/v3"
	"github.com/openai/openai-go/v3/option"
	"github.com/openai/openai-go/v3/responses"
)

func main() {
	ctx := context.Background()
	projectID := "your-project-id"
	client := openai.NewClient(
		option.WithAPIKey(os.Getenv("GOOGLE_CLOUD_ACCESS_TOKEN")),
		option.WithBaseURL("https://aiplatform.googleapis.com/v1/projects/"+projectID+"/locations/global/publishers/openai/v1"),
	)

	response, err := client.Responses.New(ctx, responses.ResponseNewParams{
		Model: "gpt-6-luna",
		Input: responses.ResponseNewParamsInputUnion{
			OfString: openai.String("Write a one-sentence bedtime story about a unicorn."),
		},
		Store: openai.Bool(false),
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(response.OutputText())
}

To get access tokens through Google’s authentication library instead of exporting them in your terminal, follow Google’s getting-started guide, which explains how to use Application Default Credentials (ADC) and troubleshoot API errors.

Feature availability

The table compares feature support on Google Cloud with the first-party OpenAI API.

Capability OpenAI API Google Cloud
API requests
Text generation Available Available
Streaming responses over HTTP (SSE) Available Available
Responses API endpoint Available Available
Response token usage Available Available
Input token count endpoint Available Not available
Realtime WebSocket connections Available Not available
Background requests Available Not available
Background stream resume Available Not available
Chat Completions API Available Not available
Batch processing Available Not available
Output and reasoning
Structured outputs with JSON Schema Available Available
JSON mode Available Available
Reasoning effort Available Available
Encrypted reasoning Available Available
Reasoning summaries Available Not available
Tools and integrations
Client-side function calling Available Available
Parallel tool calls Available Available
Structured function arguments Available Available
Custom tools Available Available with freeform input or regex constraints
Client-side tool search Available Available
Client-run MCP and namespaced tools Available Available
Client-side shell tool Available Available
Hosted web search Available Not available
Hosted file search and vector stores Available Not available
Hosted code execution Available Not available
Server-side remote MCP Available Not available
Documents and media
PDF text extraction Available Available
Inline image input Available Available
Image generation Available Not available
Conversation state
Saved conversation continuation Available Available
Stateless conversation continuation Available Available
Conversation compaction Available Available
Explicit prompt-cache controls Available Available

Data retention

Your prompts and responses are not used to train OpenAI models. Default retention is up to 30 days.

If you require Zero Data Retention (ZDR), contact your OpenAI or Google Cloud representative during onboarding and wait for confirmation of support. Setting store: false on a request does not enable ZDR.