binary-husky/gpt_academic · error · Exception
Authentication failed
Error message
Authentication failed
What it means
Synchronous (requests-based) Bing/Copilot conversation creation failed: after trying the configured BING_PROXY_URL (default https://edgeservices.bing.com/edgesvc/turing/conversation/create) and the fallback proxy edge.churchless.tech, the HTTP status was still not 200, so edge_gpt_free raises Exception('Authentication failed'). The printed status code/body/url above the raise identify the actual response.
Source
Thrown at request_llms/edge_gpt_free.py:341
headers=HEADERS_INIT_CONVER,
)
if cookies:
for cookie in cookies:
self.session.cookies.set(cookie["name"], cookie["value"])
# Send GET request
response = self.session.get(
url=os.environ.get("BING_PROXY_URL")
or "https://edgeservices.bing.com/edgesvc/turing/conversation/create",
)
if response.status_code != 200:
response = self.session.get(
"https://edge.churchless.tech/edgesvc/turing/conversation/create",
)
if response.status_code != 200:
print(f"Status code: {response.status_code}")
print(response.text)
print(response.url)
raise Exception("Authentication failed")
try:
self.struct = response.json()
except (json.decoder.JSONDecodeError, NotAllowedToAccess) as exc:
raise Exception(
"Authentication failed. You have not been accepted into the beta.",
) from exc
if self.struct["result"]["value"] == "UnauthorizedRequest":
raise NotAllowedToAccess(self.struct["result"]["message"])
@staticmethod
async def create(
proxy=None,
cookies=None,
):
self = _Conversation(async_mode=True)
self.struct = {
"conversationId": None,
"clientId": None,View on GitHub (pinned to d6bde0fa54)
Solutions
- Check the printed status code and response body — 401/403 means cookies/beta, 429 means rate limit or IP block
- Provide fresh valid Bing cookies to the conversation client (the newbing bridge passes cookies; stale cookies are the #1 cause)
- If self-hosting BING_PROXY_URL, verify that proxy is alive and forwards cookies correctly; otherwise clear the env var to use the default + fallback
- Switch to a supported model/bridge (this free endpoint is inherently unreliable) or retry later when the fallback proxy recovers
Example fix
# before
os.environ.pop('BING_PROXY_URL', None) # both bing + churchless return non-200
# after: supply valid cookies via the newbing bridge config
# config_private.py
NEWBING_COOKIES = '...fresh _U cookie from edge browser...' Defensive patterns
Strategy: retry
Validate before calling
import requests
for url in (os.environ.get('BING_PROXY_URL') or 'https://edgeservices.bing.com/edgesvc/turing/conversation/create',
'https://edge.churchless.tech/edgesvc/turing/conversation/create'):
r = requests.get(url, timeout=10)
print(url, r.status_code) # both must be 200 for the free bridge to work Try / catch
for attempt in range(2):
try:
convo = _Conversation(sync_mode=True, cookies=cookies)
break
except Exception as e:
if 'Authentication failed' in str(e) and attempt == 0:
cookies = refresh_bing_cookies()
continue
raise Prevention
- Harvest complete fresh Bing cookies before each long session
- Keep BING_PROXY_URL pointed at a proxy you control and monitor
- Treat this free endpoint as best-effort: wrap calls with retry and a fallback model
When it happens
Trigger: _Conversation.__init__ path in request_llms/edge_gpt_free.py:341: both conversation/create GETs return non-200. Typical when Bing rejects the client cookies (missing/invalid edge cookies), the beta is not enabled for the account, an IP is blocked (429/403), or the churchless fallback proxy is down.
Common situations: Using the free newbing/edge_gpt_free bridge without valid Bing cookies; region/IP blocked by edgeservices.bing.com; both endpoints rate-limited; BING_PROXY_URL pointing at a dead self-hosted proxy.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Authentication failed. You have not been accepted into the b
- Update web page context failed
- self.struct["result"]["message"]
- 在线搜索失败!\n{Exceptions}
- 无法下载资源{txt},请检查。
AI-assisted analysis of binary-husky/gpt_academic@d6bde0fa54 (2026-08-14).
Data as JSON: /api/errors/f5c983b87333487c.
Report an issue: GitHub.