mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-05-01 04:31:46 +00:00
feat: add configurable provider endpoint for codex-api accounts
Add providerEndpoint field (responses/completions/auto) to openai-responses accounts, allowing admins to specify which API endpoint format the provider supports. The relay service normalizes request paths based on this config: - responses (default): routes all requests to /v1/responses - completions: routes all requests to /v1/chat/completions - auto: preserves the original request path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,8 @@ class OpenAIResponsesAccountService {
|
||||
dailyQuota = 0, // 每日额度限制(美元),0表示不限制
|
||||
quotaResetTime = '00:00', // 额度重置时间(HH:mm格式)
|
||||
rateLimitDuration = 60, // 限流时间(分钟)
|
||||
disableAutoProtection = false // 是否关闭自动防护(429/401/400/529 不自动禁用)
|
||||
disableAutoProtection = false, // 是否关闭自动防护(429/401/400/529 不自动禁用)
|
||||
providerEndpoint = 'responses' // Provider 端点类型:responses | completions | auto
|
||||
} = options
|
||||
|
||||
// 验证必填字段
|
||||
@@ -96,7 +97,8 @@ class OpenAIResponsesAccountService {
|
||||
lastResetDate: redis.getDateStringInTimezone(),
|
||||
quotaResetTime,
|
||||
quotaStoppedAt: '',
|
||||
disableAutoProtection: disableAutoProtection.toString() // 关闭自动防护
|
||||
disableAutoProtection: disableAutoProtection.toString(), // 关闭自动防护
|
||||
providerEndpoint // Provider 端点类型:responses(默认) | completions | auto
|
||||
}
|
||||
|
||||
// 保存到 Redis
|
||||
|
||||
Reference in New Issue
Block a user