使用Nvidia接口:https://integrate.api.nvidia.com
测试账号连接的时候,日志
``2026-04-15T21:24:52.772+0800 WARN slog logger/slog_handler.go:55 account_upstream_error {"service": "sub2api", "env": "production", "account_id": 16, "status_code": 502}
2026-04-15T21:24:52.773+0800 WARN handler/openai_gateway_handler.go:347 openai.upstream_failover_switching {"service": "sub2api", "env": "production", "component": "http", "request_id": "f8e89395-3544-4de9-897f-ad87f9e4e4ae", "client_request_id": "", "path": "/v1/responses", "method": "POST", "client_request_id": "ac2daf01-b2a9-4ad1-a0f4-30953ea8c81e", "component": "handler.openai_gateway.responses", "user_id": 1, "api_key_id": 15, "group_id": 10, "model": "gpt-5.4", "stream": true, "account_id": 16, "upstream_status": 502, "switch_count": 2, "max_switches": 10}
2026-04-15T21:24:52.776+0800 WARN handler/openai_gateway_handler.go:253 openai.account_select_failed {"service": "sub2api", "env": "production", "component": "http", "request_id": "f8e89395-3544-4de9-897f-ad87f9e4e4ae", "client_request_id": "", "path": "/v1/responses", "method": "POST", "client_request_id": "ac2daf01-b2a9-4ad1-a0f4-30953ea8c81e", "component": "handler.openai_gateway.responses", "user_id": 1, "api_key_id": 15, "group_id": 10, "model": "gpt-5.4", "stream": true, "error": "no available OpenAI accounts", "excluded_account_count": 2}
2026-04-15T21:27:52.342+0800 ERROR stdlog service/account_test_service.go:539 Account test error: API returned 404: {"service": "sub2api", "env": "production", "legacy_stdlog": true}
github.com/Wei-Shaw/sub2api/internal/service.(*AccountTestService).testOpenAIAccountConnection
/home/runner/work/sub2api/sub2api/backend/internal/service/account_test_service.go:539
github.com/Wei-Shaw/sub2api/internal/service.(*AccountTestService).TestAccountConnection
/home/runner/work/sub2api/sub2api/backend/internal/service/account_test_service.go:173
github.com/Wei-Shaw/sub2api/internal/handler/admin.(*AccountHandler).Test
/home/runner/work/sub2api/sub2api/backend/internal/handler/admin/account_handler.go:685
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
main.initializeApplication.NewAdminAuthMiddleware.adminAuth.func4
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/admin_auth.go:70
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.(*FrontendServer).Middleware.func7
/home/runner/work/sub2api/sub2api/backend/internal/web/embed_on.go:87
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server/middleware.SecurityHeaders.func1
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/security_headers.go:85
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server/middleware.CORS.func2
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/cors.go:99
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.Logger.func5
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/logger.go:22
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.RequestLogger.func4
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/request_logger.go:43
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
github.com/Wei-Shaw/sub2api/internal/server.ProvideHTTPServer.MaxBytesHandler.func1
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:4071
net/http.HandlerFunc.ServeHTTP
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:2286
net/http.serverHandler.ServeHTTP
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:3311
net/http.(*conn).serve
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:2073
使用Nvidia接口:https://integrate.api.nvidia.com
测试账号连接的时候,日志
``2026-04-15T21:24:52.772+0800 WARN slog logger/slog_handler.go:55 account_upstream_error {"service": "sub2api", "env": "production", "account_id": 16, "status_code": 502}
2026-04-15T21:24:52.773+0800 WARN handler/openai_gateway_handler.go:347 openai.upstream_failover_switching {"service": "sub2api", "env": "production", "component": "http", "request_id": "f8e89395-3544-4de9-897f-ad87f9e4e4ae", "client_request_id": "", "path": "/v1/responses", "method": "POST", "client_request_id": "ac2daf01-b2a9-4ad1-a0f4-30953ea8c81e", "component": "handler.openai_gateway.responses", "user_id": 1, "api_key_id": 15, "group_id": 10, "model": "gpt-5.4", "stream": true, "account_id": 16, "upstream_status": 502, "switch_count": 2, "max_switches": 10}
2026-04-15T21:24:52.776+0800 WARN handler/openai_gateway_handler.go:253 openai.account_select_failed {"service": "sub2api", "env": "production", "component": "http", "request_id": "f8e89395-3544-4de9-897f-ad87f9e4e4ae", "client_request_id": "", "path": "/v1/responses", "method": "POST", "client_request_id": "ac2daf01-b2a9-4ad1-a0f4-30953ea8c81e", "component": "handler.openai_gateway.responses", "user_id": 1, "api_key_id": 15, "group_id": 10, "model": "gpt-5.4", "stream": true, "error": "no available OpenAI accounts", "excluded_account_count": 2}
2026-04-15T21:27:52.342+0800 ERROR stdlog service/account_test_service.go:539 Account test error: API returned 404: {"service": "sub2api", "env": "production", "legacy_stdlog": true}
github.com/Wei-Shaw/sub2api/internal/service.(*AccountTestService).testOpenAIAccountConnection
/home/runner/work/sub2api/sub2api/backend/internal/service/account_test_service.go:539
github.com/Wei-Shaw/sub2api/internal/service.(*AccountTestService).TestAccountConnection
/home/runner/work/sub2api/sub2api/backend/internal/service/account_test_service.go:173
github.com/Wei-Shaw/sub2api/internal/handler/admin.(*AccountHandler).Test
/home/runner/work/sub2api/sub2api/backend/internal/handler/admin/account_handler.go:685
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
main.initializeApplication.NewAdminAuthMiddleware.adminAuth.func4
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/admin_auth.go:70
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.(*FrontendServer).Middleware.func7
/home/runner/work/sub2api/sub2api/backend/internal/web/embed_on.go:87
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server/middleware.SecurityHeaders.func1
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/security_headers.go:85
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server/middleware.CORS.func2
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/cors.go:99
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.Logger.func5
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/logger.go:22
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/Wei-Shaw/sub2api/internal/server.SetupRouter.RequestLogger.func4
/home/runner/work/sub2api/sub2api/backend/internal/server/middleware/request_logger.go:43
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
github.com/Wei-Shaw/sub2api/internal/server.ProvideHTTPServer.MaxBytesHandler.func1
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:4071
net/http.HandlerFunc.ServeHTTP
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:2286
net/http.serverHandler.ServeHTTP
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:3311
net/http.(*conn).serve
/opt/hostedtoolcache/go/1.26.2/x64/src/net/http/server.go:2073