Skip to content

OpenAI API Error: 401 Incorecct API Key provided #6

Closed

Description

@jinchaofs

What happened?

我在阿里云百炼平台申请了免费试用(额度 100 万 Token)的 API Key,想要体验下 Qwen Coder,使用方式按照官方提供的文档执行,但是遇到了下面的问题:

Image

What did you expect to happen?

如果它不是 Bug,期望能解答下我所遇到的问题,如何解决。

Client information

Details
│                                                                     │
│ About Gemini CLI                                                    │
│                                                                     │
│ CLI Version             0.0.1-alpha.7                               │
│ Git Commit              b5a8df7 (local modifications)               │
│ Model                   qwen3-coder-plus                            │
│ Sandbox                 no sandbox                                  │
│ OS                      darwin                                      │
│ Auth Method             openai

Login information

No response

Anything else we need to know?

No response

Activity

  1. alonelaval commented on Jul 23, 2025

    @alonelaval

    ✕ [API Error: OpenAI API error: 401 Incorrect API key provided. ]

  2. deluxebear commented on Jul 23, 2025

    @deluxebear
    Image 我的配置是这样的,没有问题
  3. audiebant commented on Jul 23, 2025

    @audiebant

    Image 我的配置是这样的,没有问题

    thanks,bro.its work.The reason is that the document's OPENAI_BASE_URL is an internal address.

  4. dayL-W commented on Jul 23, 2025

    @dayL-W

    What happened?

    我在阿里云百炼平台申请了免费试用(额度 100 万 Token)的 API Key,想要体验下 Qwen Coder,使用方式按照官方提供的文档执行,但是遇到了下面的问题:

    Image ### What did you expect to happen? 如果它不是 Bug,期望能解答下我所遇到的问题,如何解决。

    Client information

    Login information

    No response

    Anything else we need to know?

    No response

    把URL改成,https://dashscope.aliyuncs.com/compatible-mode/v1

    示例中的是dashscope-intl,这个是国际站百炼,绝大部分国内用户使用的是国内百炼

  5. JRF0504 commented on Jul 23, 2025

    @JRF0504

    我更换成国内的BASE_URL解决了这个问题 #17

  6. SmarKid commented on Jul 23, 2025

    @SmarKid

    OPENAI_BASE_URL 难道不能用自己部署的模型吗

  7. added
    type/bugSomething isn't working as expected
    type/questionFurther information is requested
    and removed on Oct 17, 2025
  8. 55 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working as expectedtype/questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions