# Qwen Code: No auth type is selected

> A headless run (`qwen -p`) needs a configured way to authenticate, and none is set. The exact message, why Qwen Code prints it, and the fix.

_Updated November 23, 2026 · Checked against Qwen Code 0.24.6, reproduced in EnvHaven 1.9.0_

## The message

```text
No auth type is selected. Please configure an auth type (e.g. via settings or `--auth-type`) before running in non-interactive mode.
```

## What it means

A headless run (`qwen -p`) needs a configured way to authenticate, and none is set. Interactive runs ask for one; headless runs cannot.

## Fix

1. Run `qwen` once interactively and choose an authentication method; it is saved to settings.
2. Or pass it per run: `qwen --auth-type <type> -p "..."`, with the matching key set, such as `OPENAI_API_KEY` and an OpenAI-compatible base URL.

## In an EnvHaven workspace

Yes, until Qwen Code is configured once.

## Where this comes from

This message was produced by Qwen Code (Qwen Code 0.24.6) itself, in a throwaway EnvHaven 1.9.0 container, on 2026-11-23; the text above is copied from that output.

## Keep reading

- [Qwen Code](https://envhaven.com/agents/qwen-code)
- [Is Qwen Code down?](https://envhaven.com/status/qwen-code)
- [Every agent error](https://envhaven.com/errors)

Source: https://envhaven.com/errors/qwen-code/no-auth-type-is-selected
