[BUG] claude -p silently exits with third-party ANTHROPIC_BASE_URL, no API request made

Resolved 💬 2 comments Opened Apr 4, 2026 by zxy1994 Closed Apr 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment:

  • Windows 11 25H2 / Windows 10 LTSC 2019 (both affected)
  • Node.js v20.x
  • Claude Code 2.1.92 (npm)

Config:

  • ANTHROPIC_API_KEY set (non-Anthropic key, prefix "tp-")
  • ANTHROPIC_BASE_URL = third-party endpoint
  • ANTHROPIC_MODEL = custom model name

Behavior:

  • claude -p "say hi" exits in ~1.2s with code 0, no output
  • Network debug shows NO request to ANTHROPIC_BASE_URL
  • The third-party API works fine via curl (both normal and streaming)
  • claude --help, --version, auth status all work
  • claude (interactive) hangs indefinitely

Suspected cause:
Claude Code exits before making API call, possibly due to
key format validation or firstParty provider pre-flight check.

What Should Happen?

Environment:

  • Windows 11 25H2 / Windows 10 LTSC 2019 (both affected)
  • Node.js v20.x
  • Claude Code 2.1.92 (npm)

Config:

  • ANTHROPIC_API_KEY set (non-Anthropic key, prefix "tp-")
  • ANTHROPIC_BASE_URL = third-party endpoint
  • ANTHROPIC_MODEL = custom model name

Behavior:

  • claude -p "say hi" exits in ~1.2s with code 0, no output
  • Network debug shows NO request to ANTHROPIC_BASE_URL
  • The third-party API works fine via curl (both normal and streaming)
  • claude --help, --version, auth status all work
  • claude (interactive) hangs indefinitely

Suspected cause:
Claude Code exits before making API call, possibly due to
key format validation or firstParty provider pre-flight check.

Error Messages/Logs

Steps to Reproduce

Environment:

  • Windows 11 25H2 / Windows 10 LTSC 2019 (both affected)
  • Node.js v20.x
  • Claude Code 2.1.92 (npm)

Config:

  • ANTHROPIC_API_KEY set (non-Anthropic key, prefix "tp-")
  • ANTHROPIC_BASE_URL = third-party endpoint
  • ANTHROPIC_MODEL = custom model name

Behavior:

  • claude -p "say hi" exits in ~1.2s with code 0, no output
  • Network debug shows NO request to ANTHROPIC_BASE_URL
  • The third-party API works fine via curl (both normal and streaming)
  • claude --help, --version, auth status all work
  • claude (interactive) hangs indefinitely

Suspected cause:
Claude Code exits before making API call, possibly due to
key format validation or firstParty provider pre-flight check.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.92 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗