Skip to content

Support ~/.aicore/config.json and Python-SDK-compatible env var names for credential loading #1770

Description

@lizzzcai

Checklist

Describe the Problem

The JS SDK uses different environment variable names than the Python SDK and LiteLLM:

What it means Python SDK / LiteLLM JS SDK
Base service URL AICORE_BASE_URL AICORE_SERVICE_URL
Auth/token URL AICORE_AUTH_URL AICORE_TOKEN_URL

Additionally, the JS SDK does not support loading credentials from ~/.aicore/config.json,
which is the standard credential store created by aicore configure and used by the Python SDK.

This means developers using both SDKs in the same project must maintain two separate credential
configurations (locally or in application) — even though they point to the same AI Core instance.

Propose a Solution

  1. Support ~/.aicore/config.json as a fallback credential source.
  2. Accept AICORE_BASE_URL as an alias for AICORE_SERVICE_URL, and AICORE_AUTH_URL as an
    alias for AICORE_TOKEN_URL.

Desired credential resolution order:

  1. AICORE_SERVICE_KEY (existing)
  2. VCAP_SERVICES binding (existing)
  3. AICORE_SERVICE_URL / AICORE_BASE_URL + AICORE_CLIENT_ID + AICORE_CLIENT_SECRET
    • AICORE_TOKEN_URL / AICORE_AUTH_URL env vars
  4. ~/.aicore/config.json

Describe Alternatives

No response

Affected Development Phase

Development

Impact

Inconvenience

Timeline

No response

Additional Context

This matters most for multi-language projects and agent skill frameworks where a single
aicore configure step is expected to work for all runtimes. Currently the JS SDK requires a
separate setup step, breaking that assumption.

example friction from the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions