الأكاديمية ← أدلة تطبيقيةتوثيق رسمي · إرشاد عربي

تسجيل الدخول إلى MiniMax

MiniMax OAuth

متوسط6 دقائق قراءةالدرس 244 أسئلة✓ 2026-08-18
قبل أن تقرأ

ما هذه الصفحة، وماذا تحتوي.

الأسرار والمفاتيح: كلمات السر ومفاتيح الخدمات التي يحتاجها Hermes ليدخل إلى حساباتك. تُحفظ في مكان واحد محمي، فلا تظهر في المحادثات ولا في الملفات التي تشاركها. ستستعمل هنا hermes auth add minimax-oauth وhermes model، والقراءة نحو 6 دقائق. انتبه: لا تكتب مفتاحًا داخل محادثة ولا داخل ملف إعداد تشاركه. استعمل متغيرات البيئة أو مدير أسرار.

13أقسام
14أمثلة برمجية
4جداول
6أوامر
939كلمة من المصدر
الوصف الرسمي في سطر

Log into MiniMax via browser OAuth and use MiniMax-M2.7 models in Hermes Agent — no API key required

ماذا ستستطيع بعدها

نتائج مأخوذة من هذه الصفحة، لا من قالب.

  • تعرف ما الأسرار والمفاتيح ولماذا قد تحتاجه.
  • تنفّذ hermes auth add minimax-oauth وhermes model وتفهم ما يحدث بعدها.
  • تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
  • تضبط MINIMAX_CN_API_KEY في المكان الصحيح.
ما ستقابله من أسماء

كما تظهر تمامًا داخل Hermes.

الأوامر
  • hermes auth add minimax-oauth
  • hermes model
  • hermes config set model
  • hermes setup
  • hermes doctor
  • hermes auth logout minimax-oauth
متغيرات البيئة
  • MINIMAX_CN_API_KEY
  • MINIMAX_CN_BASE_URL
  • MINIMAX_API_KEY
  • MINIMAX_BASE_URL
خريطة الصفحة

انتقل مباشرة إلى ما تحتاجه.

  1. 01Overview
  2. 02Prerequisites
  3. 03Quick Start
  4. 04Logging In Manually
  5. 05The OAuth Flow
  6. 06Checking Login Status
  7. 07Switching Models
  8. 08Configuration Reference
  9. 09Environment Variables
  10. 10Models
  11. 11Troubleshooting
  12. 12Logging Out
  13. 13See Also
الصفحة الرسمية كاملة

بلا اختصار أو حذف.

النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.

Hermes Agent supports MiniMax through a browser-based OAuth login flow, using the same credentials as the MiniMax portal ↗. No API key or credit card is required — log in once and Hermes automatically refreshes your session.

The transport reuses the anthropic_messages adapter (MiniMax exposes an Anthropic Messages-compatible endpoint at /anthropic), so all existing tool-calling, streaming, and context features work without any adapter changes.

Overview

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

ItemValue
Provider IDminimax-oauth
Display nameMiniMax (OAuth)
Auth typeBrowser OAuth (PKCE redirect flow)
TransportAnthropic Messages-compatible (anthropic_messages)
ModelsMiniMax-M2.7, MiniMax-M2.7-highspeed
Global endpointhttps://api.minimax.io/anthropic
China endpointhttps://api.minimaxi.com/anthropic
Requires env varNo (MINIMAX_API_KEY is not used for this provider)

Prerequisites

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: كلمات السر ومفاتيح الخدمات التي يحتاجها Hermes ليدخل إلى حساباتك.

  • Python 3.9+
  • Hermes Agent installed
  • A MiniMax account at minimax.io ↗ (global) or minimaxi.com ↗ (China)
  • A browser available on the local machine (or use --no-browser for remote sessions)

Quick Start

خطوات عملية بالترتيب. نفّذ خطوة وتأكد أنها نجحت قبل الانتقال للتالية. الأوامر هنا: hermes model.

Shell9 أسطر
# Launch the provider and model picker
hermes model
# → Select "MiniMax (OAuth)" from the provider list
# → Hermes opens your browser to the MiniMax authorization page
# → Approve access in the browser
# → Select a model (MiniMax-M2.7 or MiniMax-M2.7-highspeed)
# → Start chatting

hermes

After the first login, credentials are stored under ~/.hermes/auth.json and are refreshed automatically before each session.

Logging In Manually

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. الأوامر هنا: hermes auth add minimax-oauth. تضبط MINIMAX_CN_API_KEY، MINIMAX_CN_BASE_URL خارج المحادثة، في بيئة التشغيل.

You can trigger a login without going through the model picker:

Shellسطر واحد
hermes auth add minimax-oauth

China region

If your account is on the China platform (minimaxi.com), use the API-key-based minimax-cn provider instead — minimax-cn is registered with auth_type="api_key" only (no OAuth flow). Configure MINIMAX_CN_API_KEY (and optionally MINIMAX_CN_BASE_URL) directly:

Shellسطر واحد
echo 'MINIMAX_CN_API_KEY=your-key' >> ~/.hermes/.env

Remote / headless sessions

On servers or containers where no browser is available:

Shellسطر واحد
hermes auth add minimax-oauth --no-browser

Hermes will print the verification URL and user code — open the URL on any device and enter the code when prompted.

The OAuth Flow

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Hermes implements a PKCE browser OAuth flow against the MiniMax OAuth endpoints:

  1. Hermes generates a PKCE verifier / challenge pair and a random state value.
  2. It POSTs to {base_url}/oauth/code with the challenge and receives a user_code and verification_uri.
  3. Your browser opens verification_uri. If prompted, enter the user_code.
  4. Hermes polls {base_url}/oauth/token until the token arrives (or the deadline passes).
  5. Tokens (access_token, refresh_token, expiry) are saved to ~/.hermes/auth.json under the minimax-oauth key.

Token refresh (standard OAuth refresh_token grant) runs automatically at each session start when the access token is within 60 seconds of expiry.

Checking Login Status

أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes doctor.

Shellسطر واحد
hermes doctor

The ◆ Auth Providers section will show:

Textسطر واحد
✓ MiniMax OAuth  (logged in, region=global)

or, if not logged in:

Textسطر واحد
⚠ MiniMax OAuth  (not logged in)

Switching Models

أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes config set model، hermes model.

Shell3 أسطر
hermes model
# → Select "MiniMax (OAuth)"
# → Pick from the model list

Or set the model directly:

Shellسطران
hermes config set model.default MiniMax-M2.7
hermes config set model.provider minimax-oauth

Configuration Reference

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير.

After login, ~/.hermes/config.yaml will contain entries similar to:

YAML4 أسطر
model:
  default: MiniMax-M2.7
  provider: minimax-oauth
  base_url: https://api.minimax.io/anthropic

Region endpoints

Provider idPortalInference endpoint
minimax-oauth (global)https://api.minimax.iohttps://api.minimax.io/anthropic
minimax-cn (China)https://api.minimaxi.comhttps://api.minimaxi.com/anthropic

Provider aliases

All of the following resolve to minimax-oauth:

Shell4 أسطر
hermes --provider minimax-oauth    # canonical
hermes --provider minimax-portal   # alias
hermes --provider minimax-global   # alias
hermes --provider minimax_oauth    # alias (underscore form)

Environment Variables

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. الأوامر هنا: hermes setup. تضبط MINIMAX_API_KEY، MINIMAX_BASE_URL خارج المحادثة، في بيئة التشغيل.

The minimax-oauth provider does not use MINIMAX_API_KEY or MINIMAX_BASE_URL. Those variables are for the API-key-based minimax and minimax-cn providers only.

VariableEffect
MINIMAX_API_KEYUsed by minimax provider only — ignored for minimax-oauth
MINIMAX_CN_API_KEYUsed by minimax-cn provider only — ignored for minimax-oauth

To use minimax-oauth as the active provider, set model.provider: minimax-oauth in config.yaml (use hermes setup for the guided flow), or pass --provider minimax-oauth for a single invocation:

Shellسطر واحد
hermes --provider minimax-oauth

Models

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

ModelBest for
MiniMax-M2.7Long-context reasoning, complex tool-calling
MiniMax-M2.7-highspeedLower latency, lighter tasks, auxiliary calls

Both models support up to 200,000 tokens of context.

MiniMax-M2.7 is also used automatically as the auxiliary model for vision and delegation tasks when minimax-oauth is the primary provider.

Troubleshooting

قسم لحل المشكلات. ابحث فيه عن العطل الذي يشبه حالتك بدل قراءته كاملًا. الأوامر هنا: hermes auth add minimax-oauth، hermes model.

Token expired — not re-logging in automatically

Hermes refreshes the token on every session start if it is within 60 seconds of expiry. If the access token is already expired (for example, after a long offline period), the refresh happens automatically on the next request. If refresh fails with refresh_token_reused or invalid_grant, Hermes marks the session as requiring re-login.

When the refresh failure is terminal (HTTP 4xx, invalid_grant, revoked grant, etc.), Hermes marks the refresh token as dead and quarantines it locally so it doesn't keep replaying the doomed exchange. The agent surfaces a single "re-authentication required" message and stays out of the way until you log in again.

Fix: run hermes auth add minimax-oauth again to start a fresh login. The quarantine clears on the next successful exchange.

Authorization timed out

The device-code flow has a finite expiry window. If you don't approve the login in time, Hermes raises a timeout error.

Fix: re-run hermes auth add minimax-oauth (or hermes model). The flow starts fresh.

State mismatch (possible CSRF)

Hermes detected that the state value returned by the authorization server does not match what it sent.

Fix: re-run the login. If it persists, check for a proxy or redirect that is modifying the OAuth response.

Logging in from a remote server

If hermes cannot open a browser window, use --no-browser:

Shellسطر واحد
hermes auth add minimax-oauth --no-browser

Hermes prints the URL and code. Open the URL on any device and complete the flow there.

"Not logged into MiniMax OAuth" error at runtime

The auth store has no credentials for minimax-oauth. You have not logged in yet, or the credential file was deleted.

Fix: run hermes model and select MiniMax (OAuth), or run hermes auth add minimax-oauth.

Logging Out

أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes auth logout minimax-oauth.

To remove stored MiniMax OAuth credentials:

Shellسطر واحد
hermes auth logout minimax-oauth

See Also

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

اختبار الفهم

4 أسئلة إجاباتها كلها في هذه الصفحة.

كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.

1. في جدول هذا الدرس، ما «Value» المقابل لـ«Provider ID»؟
2. أي متغير بيئة من التالي يظهر فعليًا في هذا الدرس؟
3. أي عنوان من التالي لا يظهر في هذا الدرس؟
4. أي مفتاح إعداد يظهر في أمثلة هذا الدرس؟