Skip to content

Unable to get Basic authorization headers working for OpenAIΒ #7620

@treydock

Description

@treydock

Describe the bug

πŸ’‘ Before filing, please check common issues:
https://block.github.io/goose/docs/troubleshooting

πŸ“¦ To help us debug faster, attach your diagnostics zip if possible.
πŸ‘‰ How to capture it: https://block.github.io/goose/docs/troubleshooting/diagnostics-and-reporting/

A clear and concise description of what the bug is.


To Reproduce
Steps to reproduce the behavior:

API calls work with curl:

$ curl -H "Authorization: Basic OMIT" https://LOCAL_DOMAIN/v1/models
{"object":"list","data":[{"id":"qwen3-coder:30b","object":"model","created":1772129681,"owned_by":"library"},{"id":"qwen2.5-coder:7b","object":"model","created":1771525563,"owned_by":"library"},{"id":"codellama:7b","object":"model","created":1771523458,"owned_by":"library"}]}

Attempt same with goose and get 401:

export OPENAI_CUSTOM_HEADERS="authorization=Basic OMIT"
$ grep OPENAI ~/.config/goose/config.yaml
OPENAI_HOST: https://LOCAL_DOMAIN
OPENAI_BASE_PATH: v1/chat/completions
OPENAI_TIMEOUT: '600'
$ GOOSE_DISABLE_KEYRING=1 goose run --provider openai --model qwen3-coder:30b -t "testing"

    __( O)>  ● new session Β· openai qwen3-coder:30b
   \____)    20260303_18 Β· /Users/tdockendorf/git/osc-helm-charts
     L L     goose is ready
Ran into this error: Authentication error: Authentication failed. Status: 401 Unauthorized. Response: .

Please retry if you think this is a transient or recoverable error.

I have tried several permutations of OPENAI_CUSTOM_HEADERS with quotes around the value, etc and nothing seems to work.


Expected behavior

I would expect that the OpenAI custom headers could support basic auth.


Screenshots
If applicable, add screenshots to help explain your problem.


Please provide the following information

  • OS & Arch: OS X 14.8.3
  • Interface: CLI
  • Version: 1.26.1
  • Extensions enabled: Just the defaults, this is a fresh install
  • Provider & Model: OpenAI with local Ollama using basic Auth. Model is qwen3-coder:30b

Additional context

I get the same 401 when I go through goose configure. I've been trying to debug with goose run as that seems faster than going through all the configure prompts.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions