AI Providers¶
Supported providers¶
openaigemini(AI Studio)vertex_gemini(Vertex AI)openrouterperplexity
Capability matrix (v0.0.4 release line)¶
| Provider | Text | Structured | Tool Calls | Image Generation | Image Understanding |
|---|---|---|---|---|---|
openai | Yes | Yes | Yes | Yes | Yes |
gemini | Yes | Yes | Yes | Yes (model-dependent) | Yes |
vertex_gemini | Yes | Yes | Yes | No (throws AstAiCapabilityError) | Yes |
openrouter | Yes | Yes | Yes | Model-dependent | Model-dependent |
perplexity | Yes | Yes | Yes | Model-dependent | Model-dependent |
Unsupported operation/provider pairs throw AstAiCapabilityError.
Script property keys¶
OpenAI¶
OPENAI_API_KEYOPENAI_MODEL
Gemini (AI Studio)¶
GEMINI_API_KEYGEMINI_MODEL
Vertex Gemini¶
VERTEX_PROJECT_IDVERTEX_LOCATIONVERTEX_GEMINI_MODELVERTEX_SERVICE_ACCOUNT_JSON(optional; enables service-account auth mode)VERTEX_AUTH_MODE(optional:oauth|service_account|auto, defaultauto)
Vertex auth modes:
oauth: require OAuth token path (auth.oauthToken/auth.accessTokenorScriptApp.getOAuthToken()).service_account: require service account JSON (auth.serviceAccountJsonorVERTEX_SERVICE_ACCOUNT_JSON) and exchange JWT for access token.auto(default): prefer service-account JSON when present, otherwise fallback to OAuth.
Service-account token_uri is validated against an allowlist: - https://oauth2.googleapis.com/token - https://www.googleapis.com/oauth2/v4/token
OpenRouter¶
OPENROUTER_API_KEYOPENROUTER_MODELOPENROUTER_HTTP_REFERER(optional)OPENROUTER_X_TITLE(optional)
Perplexity¶
PERPLEXITY_API_KEYPERPLEXITY_MODEL
Precedence for auth/model values¶
For each required key:
- per-call
request.auth.*(orrequest.model) - runtime config from
ASTX.AI.configure(...) - script properties
- throw
AstAiAuthError
For Vertex service-account JSON specifically:
request.auth.serviceAccountJson(object or JSON string)ASTX.AI.configure({ VERTEX_SERVICE_ACCOUNT_JSON: ... })- script property
VERTEX_SERVICE_ACCOUNT_JSON - fallback to OAuth path when
authMode=auto
Notes¶
providerOptionsare passed through to provider payloads for advanced use.- Keep provider/model mappings explicit in production automations for deterministic behavior.