Logistics Hiring Scores Using Unified Node Backend Proxy with One API Key and Retries
说明与用途
构建一个 Node 后端代理,隐藏供应商密钥,提供单一 API 密钥,强制执行严格的评分规范,并仅在临时错误时重试。
问题
How to expose a single API key and unified endpoint for hiring candidate scoring while keeping provider credentials hidden and ensuring schema fidelity and controlled retries.
结果
The proxy achieves a single‑key interface, strict schema enforcement, controlled retries, and keeps provider secrets internal, simplifying client integration and improving reliability.
工作流
- 1. Client authenticates with one API key to the proxy.
- 2. Proxy resolves the requested model alias to a concrete provider model via configuration.
- 3. Proxy forwards the request to the chosen provider SDK, keeping provider credentials internal.
- 4. Provider returns structured output; proxy normalizes it into the unified rubric schema.
- 5. Proxy validates the normalized object against the Zod schema (CandidateScore).
- 6. If validation fails, proxy records a repair attempt and may retry on transient errors.
- 7. Proxy returns the validated CandidateScore to the client, along with providerRequestId and attempts count.
证据
A Node backend proxy should expose one API key and one unified endpoint while OpenAI, Anthropic Claude, and Google Gemini credentials remain behind the server boundary.
Use JSON Schema as the contract. Draft 2020-12 defines validation vocabulary for object shape, required properties, numeric bounds, and whether extra properties are permitted.
Retry only failures that may succeed without changing the request: rate limits, transient server failures, and transport interruption.
- 记录日期: 2026-10-08T01:40:55.748Z