跳至内容
logo regular
logo regular

🚀 Quickstart

1
  • Get Started with 123API in 5 Minutes: Send Your First Chat Request

🗂️ Model Catalog

1
  • Best Conversation Models of 2026 Compared: GPT vs Claude vs Gemini vs DeepSeek

📖 Cookbook / Tutorials

1
  • Build an AI Chatbot from Scratch with 123API

💳 Cost & Billing

1
  • 7 Ways to Cut Your AI API Costs by Up to 70%

❓ FAQ & Troubleshooting

1
  • 401 / 403 Auth Failure: 123API Key Troubleshooting
View Categories
  • 首页
  • Doc
  • ❓ FAQ & Troubleshooting
  • 401 / 403 Auth Failure: 123API Key Troubleshooting

401 / 403 Auth Failure: 123API Key Troubleshooting

123api
更新 3 9 月, 2026

1 min read

A 401 or 403 means 123API rejected your request’s authentication. Both are fixable in minutes. This guide covers the causes and the exact fix.

What the codes mean #

  • 401 Unauthorized — no or invalid API key.
  • 403 Forbidden — key is valid but lacks permission (e.g., banned, wrong scope).

Common causes #

SymptomLikely causeFix
401 on every callMissing Authorization headerAdd Authorization: Bearer <key>
401 after deployKey stored as wrong env varVerify AI_API_KEY is loaded
403Key revoked / quota barredRotate key in dashboard

Step-by-step fix #

  1. Confirm the header is exactly Authorization: Bearer sk-... (no extra spaces).
  2. Print the key server-side to confirm it loaded.
  3. Rotate the key in the quickstart dashboard.
  4. Still failing? Check rate limits and retries — repeated auth errors can signal a blocker.

Prevent recurrence #

Keep keys server-side, use a secrets manager, and never commit them. For the full list of status codes, see the API Reference.

FAQ

Is 401 the same as 429? No — 401 is auth; 429 is rate limiting (see troubleshooting guide). Where do I rotate my key? In the dashboard under API Keys.

Suggested internal links (positions)

  1. “Rotate key in the [dashboard]” → dashboard (anchor: “dashboard” / “quickstart dashboard”).
  2. “Check [rate limits and retries]” → rate limits and retries (anchor: “rate limits and retries”).
  3. “see the [API Reference]” (full status codes) → API Reference (anchor: “API Reference”).
  4. “see [troubleshooting guide]” (429) → troubleshooting guide (anchor: “troubleshooting guide”).
401 / 403 Auth Failure: 123API Key Troubleshooting401 / 403 Auth Failure: 123API Key Troubleshooting

发表回复 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

内容目录
  • What the codes mean
  • Common causes
  • Step-by-step fix
  • Prevent recurrence

分享这篇文章 :

  • Facebook
  • X
  • LinkedIn
  • Pinterest

Was it helpful ?

  • Happy
  • 常规
  • Sad

Copyright © 2026 123API | Powered by 123API