- GCP Project active.
- Billing enabled.
- Vertex AI API enabled.
- Service Account with "Vertex AI User" role.
- Go GCP Console.
- Create or select existing Project. Note
PROJECT_ID. - Go APIs & Services. Search "Vertex AI API". Click Enable.
- Go IAM & Admin -> Service Accounts.
- Create Service Account. Name:
kconsole-vertex-sa. - Grant Role:
Vertex AI User. - Keys -> Add Key -> Create New Key -> JSON.
- Download JSON key file.
- Set environment variable for kconsole runtime:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/kconsole-vertex-sa.json"
Vertex AI requires specific region endpoints. kconsole routing logic must handle this.
Base URL Pattern:
https://[REGION]-aiplatform.googleapis.com/v1/projects/[PROJECT_ID]/locations/[REGION]/publishers/google/models/[MODEL_ID]:streamGenerateContent
Common Regions: us-central1, europe-west4, asia-southeast1.
Common Models: gemini-3-flash-preview, gemini-3.1-flash-lite-preview, gemini-3.1-pro-preview, and image models like imagen-3.0-generate-001 (or latest preview).
kconsole must dynamically generate OAuth tokens using the Service Account JSON.
- If Node/Python: use official Google Auth SDK to fetch token.
- HTTP Header required for request:
Authorization: Bearer <OAUTH_TOKEN>
kconsole must adapt standard OpenAI-style payloads to Vertex Gemini format.
kconsole Input (OpenAI style):
{
"model": "gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": "Hello"}]
}kconsole Output (Vertex style):
{
"contents": [
{
"role": "user",
"parts": [{"text": "Hello"}]
}
],
"generationConfig": {
"temperature": 0.7
}
}- Start kconsole with Vertex adapter enabled.
- Send test cURL to kconsole gateway port:
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <kconsole_api_key>" \
-d '{
"model": "vertex/gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": "Test vertex integration"}]
}'- Verify successful response format matches OpenAI standard.