[BUG] ANTHROPIC_API_KEY and ANTHROPIC_MODEL doesn't work when using agent teams

Resolved 💬 3 comments Opened Feb 24, 2026 by ParadeTo Closed Feb 27, 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?

I have set the ANTHROPIC_API_KEY and ANTHROPIC_MODEL in ~/.claude/setting.json, but when claude code create teammate, it did not use the variables, and I got "API Error: 400 apijson: was not able to find discriminated union variant"

What Should Happen?

Should work well.

Error Messages/Logs

Steps to Reproduce

1 set the ANTHROPIC_API_KEY and ANTHROPIC_MODEL in ~/.claude/setting.json
2 run claude code and tell it to create a agent team to complete a work.

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.50

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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