fix: исправить заголовок авторизации для DeepSeek и Kimi
Anthropic SDK отправляет ключ в заголовке x-api-key, а не Authorization: Bearer. Проверочные запросы теперь используют тот же заголовок, что и реальные вызовы. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -436,7 +436,7 @@ reauth=0
|
|||||||
|
|
||||||
if [ -n "$api_key" ]; then
|
if [ -n "$api_key" ]; then
|
||||||
echo -n "Проверка сохранённого DeepSeek ключа... "
|
echo -n "Проверка сохранённого DeepSeek ключа... "
|
||||||
_claude_test_api "https://api.deepseek.com/anthropic/v1/messages" "Authorization: Bearer $api_key" "deepseek-v4-flash"
|
_claude_test_api "https://api.deepseek.com/anthropic/v1/messages" "x-api-key: $api_key" "deepseek-v4-flash"
|
||||||
_handle_api_response "DeepSeek" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.deepseek.com/top_up"
|
_handle_api_response "DeepSeek" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.deepseek.com/top_up"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 401 ]; then
|
if [ $ret -eq 401 ]; then
|
||||||
@@ -462,7 +462,7 @@ if [ -z "$api_key" ]; then
|
|||||||
[ -z "$api_key" ] && { echo "Выход."; exit 1; }
|
[ -z "$api_key" ] && { echo "Выход."; exit 1; }
|
||||||
|
|
||||||
echo -n "Проверяю ключ и баланс... "
|
echo -n "Проверяю ключ и баланс... "
|
||||||
_claude_test_api "https://api.deepseek.com/anthropic/v1/messages" "Authorization: Bearer $api_key" "deepseek-v4-flash"
|
_claude_test_api "https://api.deepseek.com/anthropic/v1/messages" "x-api-key: $api_key" "deepseek-v4-flash"
|
||||||
_handle_api_response "DeepSeek" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.deepseek.com/top_up"
|
_handle_api_response "DeepSeek" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.deepseek.com/top_up"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
@@ -501,7 +501,7 @@ reauth=0
|
|||||||
|
|
||||||
if [ -n "$api_key" ]; then
|
if [ -n "$api_key" ]; then
|
||||||
echo -n "Проверка сохранённого Kimi ключа... "
|
echo -n "Проверка сохранённого Kimi ключа... "
|
||||||
_claude_test_api "https://api.moonshot.ai/anthropic/v1/messages" "Authorization: Bearer $api_key" "kimi-k2.6"
|
_claude_test_api "https://api.moonshot.ai/anthropic/v1/messages" "x-api-key: $api_key" "kimi-k2.6"
|
||||||
_handle_api_response "Kimi" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.moonshot.ai/console/billing"
|
_handle_api_response "Kimi" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.moonshot.ai/console/billing"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 401 ]; then
|
if [ $ret -eq 401 ]; then
|
||||||
@@ -527,7 +527,7 @@ if [ -z "$api_key" ]; then
|
|||||||
[ -z "$api_key" ] && { echo "Выход."; exit 1; }
|
[ -z "$api_key" ] && { echo "Выход."; exit 1; }
|
||||||
|
|
||||||
echo -n "Проверяю ключ и баланс... "
|
echo -n "Проверяю ключ и баланс... "
|
||||||
_claude_test_api "https://api.moonshot.ai/anthropic/v1/messages" "Authorization: Bearer $api_key" "kimi-k2.6"
|
_claude_test_api "https://api.moonshot.ai/anthropic/v1/messages" "x-api-key: $api_key" "kimi-k2.6"
|
||||||
_handle_api_response "Kimi" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.moonshot.ai/console/billing"
|
_handle_api_response "Kimi" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.moonshot.ai/console/billing"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user