How to provide Google Vertex AI API key in the .env file
Hi Team,
I have tried multiple methods of adding Anthropic's Claude models Vertex AI keys but the application couldn't parse it. Please help me on this configuration.
hey @lethalcyanide
Vertext AI is not supported now, to connect this provider try to use LiteLLM a front of PentAGI and custom provider type on PentAGI side to connect to LiteLLM.
Hi @lethalcyanide — thanks for the question.
Native Google Vertex AI is not currently a supported provider. The supported provider types are: openai, anthropic, gemini, bedrock, ollama, custom, deepseek, glm, kimi, qwen (see backend/pkg/providers/provider/provider.go). A few notes specific to Google/Anthropic:
GEMINI_API_KEY/GEMINI_SERVER_URLtarget Google AI Studio (https://generativelanguage.googleapis.com), not Vertex AI — they don't accept Vertex project credentials.ANTHROPIC_API_KEY/ANTHROPIC_SERVER_URLtarget the direct Anthropic API, not Claude-via-Vertex.
So there is no .env key that takes a Vertex AI key directly today.
Recommended workaround: the custom (OpenAI-compatible) provider via a proxy
PentAGI ships a custom provider that talks to any OpenAI-compatible /chat/completions + /models endpoint. Front Vertex AI with a proxy such as LiteLLM (which natively supports both Gemini and Claude on Vertex) and point the custom provider at it:
# .env — custom LLM provider
LLM_SERVER_URL=http://your-litellm-proxy:4000/v1
LLM_SERVER_KEY=<your-proxy-key>
LLM_SERVER_MODEL=<model-id-as-exposed-by-proxy>
LLM_SERVER_PROVIDER=custom
# optional: a JSON file mapping agent roles -> models
LLM_SERVER_CONFIG_PATH=
Your Vertex credentials (service-account JSON / GOOGLE_APPLICATION_CREDENTIALS, project, region) live in the proxy configuration, not in PentAGI. The proxy handles auth and exposes plain OpenAI-style endpoints that PentAGI consumes.
If you want native Vertex support
That would be a new provider (vertex) implementing the provider.Provider interface plus registration/config/migration wiring. If that's of interest, it's worth opening a separate enhancement issue so maintainers can scope it — happy to help there.
Would the LiteLLM-proxy route work for your setup?
Opened #321 to track native Vertex AI provider support as a scoped enhancement (with an implementation plan following the repo's "Adding a New LLM Provider" checklist). The LiteLLM-proxy workaround above remains the path until that lands.