Environment:AI Shell Team Aish API Credentials
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, LLMs, Observability |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Runtime credential environment for LLM provider API keys, Codex/ChatGPT OAuth tokens, and optional Langfuse observability keys, configured via environment variables and the aish config file.
Description
aish communicates with LLM providers (Anthropic, OpenAI, Codex/ChatGPT, and OpenAI-compatible endpoints) using API keys or OAuth tokens stored in the config file or environment variables. The config loader (`aish-config/src/loader.rs`) reads `AISH_API_KEY`, `AISH_MODEL`, `AISH_API_BASE` from the environment as overrides. The Codex provider resolves auth from `AISH_CODEX_AUTH_PATH` or `CODEX_HOME`. Langfuse observability tracing requires `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and optionally `LANGFUSE_BASE_URL`.
Usage
Use this environment whenever aish needs to make LLM API calls, run the agentic tool loop, or send traces to Langfuse. It is the prerequisite for the setup wizard connectivity verification, the agentic loop, and the sub-agent spawning workflows.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Any (Linux, macOS, WSL2) | Credentials are platform-agnostic |
| Network | Outbound HTTPS to provider API endpoints | Required for LLM calls; proxy configurable via `AISH_API_BASE` |
| Disk | `~/.config/aish/` or `$AISH_CONFIG_DIR` | Config file stores encrypted credentials |
Dependencies
System Packages
- No additional system packages beyond the Rust runtime
Config File Keys
- `provider` — LLM provider name (e.g., `anthropic`, `openai`, `codex`)
- `model` — Model identifier (overridable via `AISH_MODEL`)
- `api_key` — Provider API key (overridable via `AISH_API_KEY`)
- `api_base` — Custom API endpoint (overridable via `AISH_API_BASE`)
Credentials
The following environment variables may be set:
- `AISH_API_KEY` — Primary LLM provider API key
- `AISH_MODEL` — Model name override
- `AISH_API_BASE` — Custom API base URL (e.g., for proxies)
- `AISH_CODEX_AUTH_PATH` — Path to Codex auth JSON file
- `CODEX_HOME` — Codex/ChatGPT home directory (alternative to `HOME`)
- `AISH_CONFIG_DIR` — Override config directory location
- `LANGFUSE_PUBLIC_KEY` — Langfuse public key (observability)
- `LANGFUSE_SECRET_KEY` — Langfuse secret key (observability)
- `LANGFUSE_BASE_URL` — Langfuse server URL (self-hosted or cloud)
- `GITHUB_TOKEN` — GitHub token for skill installer rate-limit avoidance
Warning: Never commit actual secret values to the repository or wiki. These are listed by name only.
Quick Install
# Set up LLM credentials (choose your provider):
export AISH_API_KEY="sk-ant-..."
export AISH_MODEL="claude-sonnet-5-5"
# Or configure interactively:
aish # launches setup wizard on first run
# Optional: Langfuse observability
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_BASE_URL="https://cloud.langfuse.com"
# Optional: Codex/ChatGPT OAuth
export AISH_CODEX_AUTH_PATH="$HOME/.codex/auth.json"
Code Evidence
Environment variable overrides from `crates/aish-config/src/loader.rs:172-184`:
if let Ok(v) = std::env::var("AISH_MODEL") {
// ... override model
}
if let Ok(v) = std::env::var("AISH_API_KEY") {
// ... override api_key
}
if let Ok(v) = std::env::var("AISH_API_BASE") {
// ... override api_base
}
if let Ok(v) = std::env::var("AISH_CODEX_AUTH_PATH") {
// ... override codex auth path
}
Langfuse credential resolution from `crates/aish-llm/src/langfuse.rs:41-54`:
let public_key = std::env::var("LANGFUSE_PUBLIC_KEY")
.or_else(|_| config.langfuse_public_key.clone().ok_or(...));
let secret_key = std::env::var("LANGFUSE_SECRET_KEY")
.or_else(|_| config.langfuse_secret_key.clone().ok_or(...));
let base_url = std::env::var("LANGFUSE_BASE_URL")
.or_else(|_| config.langfuse_host.clone().ok_or(...));
Codex auth path resolution from `crates/aish-llm/src/providers/codex.rs:175-183`:
if let Ok(env_path) = std::env::var("AISH_CODEX_AUTH_PATH") {
return PathBuf::from(env_path);
}
if let Ok(codex_home) = std::env::var("CODEX_HOME") {
return PathBuf::from(codex_home).join("auth.json");
}
let home = std::env::var("HOME")
.or_else(|_| std::env::var("USERPROFILE"))
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `⚠️ Langfuse configuration is incomplete` | Missing `LANGFUSE_PUBLIC_KEY` or `LANGFUSE_SECRET_KEY` | Set both env vars or disable Langfuse tracing in config |
| `connection refused or unreachable: {url}` | Wrong API base URL or network blocked | Check `AISH_API_BASE` and outbound HTTPS connectivity |
| `Unauthorized` / `401` | Invalid or expired API key | Re-run setup wizard or update `AISH_API_KEY` |
| `Codex auth file not found` | `CODEX_HOME` or `AISH_CODEX_AUTH_PATH` not set | Run `aish` setup wizard for Codex provider |
Compatibility Notes
- Multiple providers: The config file can store credentials for multiple providers; `AISH_API_KEY` always overrides the file value for the active provider.
- Langfuse is optional: If `LANGFUSE_PUBLIC_KEY`/`LANGFUSE_SECRET_KEY` are not set, tracing is silently disabled.
- MCP child isolation: MCP server child processes do not inherit `AISH_API_KEY` or other credentials — only a 12-variable allowlist is passed (see Heuristic:AI_Shell_Team_Aish_Sandbox_Env_Allowlist).
- Codex OAuth: The Codex/ChatGPT provider uses OAuth PKCE tokens stored in `auth.json`, not raw API keys.