nexu-io/open-design · error · RuntimeError
OpenAI selected but no valid OpenAI auth is configured.
Error message
OpenAI selected but no valid OpenAI auth is configured.
What it means
Raised in resolve_runtime when provider_name is 'openai' but either OPENAI_API_KEY is empty or OPENAI_AUTH_STATUS != 'ok'. Unlike gemini, OpenAI requires BOTH a token and an explicit auth-status handshake (env.AUTH_STATUS_OK) because the runtime also supports ChatGPT-session auth, not just API keys.
Source
Thrown at design-templates/last30days/scripts/lib/providers.py:299
), None
planner_model, rerank_model = _resolve_model_pins(config, depth, provider_name)
if provider_name == "gemini":
if not google_key:
raise RuntimeError("Gemini selected but no Google API key is configured.")
runtime = schema.ProviderRuntime(
reasoning_provider="gemini",
planner_model=planner_model,
rerank_model=rerank_model,
x_search_backend=_resolve_x_backend(config),
)
return runtime, GeminiClient(google_key)
if provider_name == "openai":
if not openai_token or config.get("OPENAI_AUTH_STATUS") != env.AUTH_STATUS_OK:
raise RuntimeError("OpenAI selected but no valid OpenAI auth is configured.")
runtime = schema.ProviderRuntime(
reasoning_provider="openai",
planner_model=planner_model,
rerank_model=rerank_model,
x_search_backend=_resolve_x_backend(config),
)
return runtime, OpenAIClient(
openai_token,
config.get("OPENAI_AUTH_SOURCE") or env.AUTH_SOURCE_API_KEY,
config.get("OPENAI_CHATGPT_ACCOUNT_ID"),
)
if provider_name == "xai":
if not xai_key:
raise RuntimeError("xAI selected but XAI_API_KEY is not configured.")
runtime = schema.ProviderRuntime(
reasoning_provider="xai",View on GitHub (pinned to 5be4028344)
Solutions
- Set OPENAI_API_KEY and OPENAI_AUTH_STATUS=ok together when using API-key auth.
- Re-run the OpenAI login/handshake step so it stamps OPENAI_AUTH_STATUS=ok into config.
- If you do not have valid OpenAI auth, switch LAST30DAYS_REASONING_PROVIDER to gemini/xai/openrouter/auto.
Example fix
# before OPENAI_API_KEY=sk-... # OPENAI_AUTH_STATUS missing # after OPENAI_API_KEY=sk-... OPENAI_AUTH_STATUS=ok OPENAI_AUTH_SOURCE=api_key
Defensive patterns
Strategy: validation
Validate before calling
from lib import env
def ensure_openai_auth(config):
token = config.get("OPENAI_API_KEY")
status = config.get("OPENAI_AUTH_STATUS")
if not token or status != env.AUTH_STATUS_OK:
raise RuntimeError(
"OpenAI provider requires OPENAI_API_KEY and OPENAI_AUTH_STATUS=ok."
)
return token Type guard
null
Try / catch
null
Prevention
- When using API-key auth, always set OPENAI_API_KEY together with OPENAI_AUTH_STATUS=ok and OPENAI_AUTH_SOURCE=api_key.
- Re-run the OpenAI auth handshake whenever the token is refreshed so the status field stays 'ok'.
- Use 'auto' provider selection so an incomplete OpenAI auth falls through to another provider.
When it happens
Trigger: LAST30DAYS_REASONING_PROVIDER=openai with OPENAI_API_KEY set but OPENAI_AUTH_STATUS unset or set to a non-'ok' value. Also reached via auto-resolution when a key exists but the auth handshake failed.
Common situations: Setting OPENAI_API_KEY directly without also setting OPENAI_AUTH_STATUS=ok. Auth token expired (ChatGPT session refresh failed) so status flipped to a non-ok value. Auto-resolution picked openai because the key was present but the status check was skipped.
Related errors
- Gemini selected but no Google API key is configured.
- xAI selected but XAI_API_KEY is not configured.
- OpenRouter selected but OPENROUTER_API_KEY is not configured
- Cloudflare API token is required.
- no ElevenLabs API key - configure it in Settings or set OD_E
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/6265f3e7624d08e8.
Report an issue: GitHub.