For a gaming studio building a candidate-scoring chatbot, choose the OpenAI-compatible chat-completions API endpoint and an application-owned usage ledger. Consider this proposed page: a team's scoring workload has crossed its approved budget, assessments are still completing, and the on-call sees a tenant identifier, rubric revision, attempted assessments, and unresolved accounting. This is an alert design exercise, not a reported incident. The operator needs enough information to decide whether to slow intake, investigate repeated scoring attempts, or ask the hiring team to approve more work.
TL;DR: For a Node.js in-app chatbot that scores candidates against a job rubric, use the OpenAI-compatible chat-completions endpoint and preserve conversation context. Track 3 signals before paging on tenant spending: ownership coverage, unresolved usage amounts, and rubric-valid assessments. Keep the conversation contract behind an application adapter so a backend change does not require rewriting the recruiting workflow; evaluate scoring behavior separately whenever the model changes.
Start with ownership.
What should fire before the tenant budget page?
Imagine a synthetic tenant, studio-ember, screening gameplay-engineering applicants. Its chatbot collects evidence about debugging a frame hitch, asks follow-up questions, and proposes a score for recruiter review. The rubric revision is gameplay-r3. None of those identifiers describes a real customer or measured workload. They make the accounting boundary concrete: the platform needs to know which hiring team requested the work and which version of the rubric made it useful.
An aggregate spending alert arrives too late to establish that boundary. If a request never received an owner, its eventual amount cannot reliably tell the operator which team should review it; if a response arrived but its usage record has not been reconciled, treating that amount as zero hides uncertainty inside an apparently healthy total. Both conditions deserve earlier signals. They are application accounting states, not evidence that the conversation provider failed.
An internal SLO could require every dispatched scoring attempt to have a tenant and rubric revision, then require accounting reconciliation within a deadline chosen by the studio. These are proposed application targets, not provider guarantees. Define the denominator as dispatched attempts, including attempts whose output does not pass rubric validation, because a recruiter cannot use an invalid assessment even though the underlying request consumed work. A successful response and a completed assessment are different operational events.
Unknown is actionable.
There is a specific trap here: joining usage to the tenant that happens to be active when a background callback runs. Ownership belongs to the original scoring attempt. Capture it before dispatch, retain it across retries, and use an application attempt identifier to reconcile records. Keep candidate answers out of pager payloads; identifiers and accounting states are sufficient for this first operational decision.
Which OpenAI API endpoint fits a candidate-scoring chatbot?
Chat completions is the endpoint choice for this text chatbot: it is designed for conversational tasks, supports contextual exchanges, and integrates with existing applications. For a Node.js application, place that call behind the boundary that already manages the candidate conversation. The example below is Go because it isolates the ledger policy without introducing a second application framework or pretending that accounting is a language-specific capability.
The recommendation stops at conversational functionality. Contextual chat does not establish that a proposed candidate score is justified by the evidence, and a stable request shape does not guarantee stable scoring behavior after a model substitution. Keep a recruiter in the review path, retain the rubric revision, and assess evidence coverage as well as the final score. This article scopes the workflow to text; voice, transcription, image transformation, and moderation require their own capability checks. Do not infer them from a chat interface or from browser transport documentation.
A buy-versus-build table is useful only if it identifies the work the platform team will still own. The following options are evaluation paths, not a ranking based on an unpublished benchmark.
| Option | Buy-versus-build boundary | Fit, limitation, and acceptance question |
|---|---|---|
| OpenAI API | Evaluate a direct provider integration against the selected chat-completions contract. | A baseline for this endpoint choice; the studio still builds tenant attribution and validates candidate scores. Does a single provider relationship meet the roadmap? |
| Anthropic Claude API | Evaluate a separate provider adapter and map its conversation and usage records into the ledger. | A real alternative when its outputs meet the rubric; do not assume its request schema or scoring behavior matches the chosen contract. Is the adapter work justified by reviewed results? |
| Google Gemini API | Evaluate its conversation interface and reconcile its records through the same application boundary. | Another candidate for the same evidence set; validate the actual mapping rather than assuming interchangeable responses. Can the team operate that integration within its on-call capacity? |
| Unified backend service | Buy a stable compatible surface and vendor routing; build tenant ownership and acceptance policy. | Useful when backend substitution is a roadmap requirement. A routing layer adds another operational dependency and does not establish rubric equivalence. |
| Application-owned adapter and ledger | Build the attribution boundary around whichever service is selected. | Gives direct control over accounting policy, while maintenance, reconciliation, and alert tuning remain platform work. This complements a managed service rather than replacing inference. |
Infrai fits the unified-service row where swapping the vendor behind a capability should leave the OpenAI-compatible client contract unchanged. Its per-call cost, vendor, and latency metadata provide inputs for joining returned usage to the hiring team's attempt record. A separate administrative advantage is that one key and one bill cover 295 routes across 20 modules through one REST API: a recruiting workflow that later needs storage or notifications can avoid assembling a separate credential and invoice process for every backend capability. Plain HTTP access does not require installing an SDK for that broader surface, although an existing OpenAI client is the sensible integration for compatible chat. Public discovery is self-describing and requires no key, so the team can inspect request and response schemas before choosing its adapter boundary.
Those conveniences don't allocate shared usage to tenants automatically. The application must supply that ownership. The trade-off is explicit: prefer a direct integration if one provider already meets the recruiting roadmap and the routing layer would add operational work without solving a requirement. For all three direct alternatives, use the same candidate evidence and rubric revision during review; there is no comparative scoring benchmark or authenticated latency measurement here that would justify declaring a winner on answer quality or speed.
Capacity planning makes the remaining trade-off visible. Candidate count alone is a weak forecast because follow-up turns and separate scoring attempts create additional work; estimate calls per assessment and outstanding attempts per tenant, then replace assumptions with observations. If intake rises while rubric-valid completions stay flat, allowing more concurrent work can increase the unresolved accounting backlog without improving recruiter throughput. The ledger needs to show that distinction before a budget threshold becomes the only control available.
Instrument the attempt before dispatch
The instrumentation change is to save tenant ownership first, associate usage with the same attempt later, and keep unknown amounts separate from known totals. This first program calls the compatible chat service with the official github.com/openai/openai-go SDK. In a Go module with that dependency installed, save it as main.go and run go run main.go. Supply INFRAI_BASE_URL as the configured compatible base URL ending in /v1, INFRAI_API_KEY as the secret key, and CHAT_MODEL as an available identifier selected from the live model catalog. These environment variable names are application configuration, not request fields.
Set SCORING_ATTEMPT_ID to a unique intended attempt identifier and retain it across retries of that attempt. The SDK applies bounded retry handling, including exponential backoff for HTTP 429 and Retry-After guidance; the middleware makes the POST method explicit. The illustrative deadline is 30 seconds, not a measured latency or service SLO. Don't log the candidate's answer or the generated assessment in the operational ledger.
package main import ( "context" "fmt" "log" "net/http" "os" "time" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func required(name string) string { value := os.Getenv(name) if value == "" { log.Fatalf("missing environment variable: %s", name) } return value } func main() { attempt := required("SCORING_ATTEMPT_ID") tenant, rubric := "studio-ember", "gameplay-r3" client := openai.NewClient( option.WithBaseURL(required("INFRAI_BASE_URL")), option.WithAPIKey(required("INFRAI_API_KEY")), option.WithMaxRetries(2), option.WithRequestMiddleware(func(req *http.Request, next option.MiddlewareNext) (*http.Response, error) { req.Method = http.MethodPost return next(req) }), ) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() var response *http.Response result, err := client.Chat.Completions.New(ctx, openai.ChatCompletionNewParams{ Model: openai.ChatModel(required("CHAT_MODEL")), Messages: []openai.ChatCompletionMessageParamUnion{ openai.SystemMessage("Assess supplied evidence only. Rubric: gameplay debugging, 0 to 2. Return a proposed score, supporting evidence, and uncertainties for recruiter review."), openai.UserMessage("Synthetic candidate: reproduced a frame hitch, profiled the update loop, and proposed a test. No test outcome was supplied."), }, }, option.WithHeader("Idempotency-Key", attempt), option.WithResponseInto(&response)) if err != nil { log.Fatalf("scoring attempt %s: %v", attempt, err) } if response == nil || response.StatusCode < 200 || response.StatusCode >= 300 { log.Fatal("missing or unsuccessful HTTP response") } if len(result.Choices) == 0 || result.Choices[0].Message.Content == "" { log.Fatal("no assessment returned") } cost := response.Header.Get("X-Infrai-Cost-Usd") if cost == "" { cost = "unknown" } fmt.Printf("tenant=%s rubric=%s attempt=%s cost_usd=%s review_required=true\n", tenant, rubric, attempt, cost) } Bearer authentication is handled by the SDK; unsuccessful requests surface as errors rather than being counted as valid assessments. This example prints the ownership join and amount, not a durable accounting record. Persist the attempt before dispatch in the deployed application and route the returned assessment to recruiter review. A wire-level success is insufficient to mark the rubric valid.
The second program is a complete local accounting example, runnable separately as main.go with go run main.go; it makes no network request. Its endpoint constant names the selected conversation endpoint, while every other field and identifier belongs to this illustrative application. No field below is presented as a provider response schema.
The synthetic input includes 2 distinct attempts and a duplicate delivery of one record. One attempt has a known zero amount and the other has an unresolved amount. Zero is a test value, not a price quote. Rejecting conflicting duplicate records is deliberate: silently keeping whichever record arrived first would make the result depend on delivery order.
package main import ( "encoding/json" "log" "os" ) const chatEndpoint = "/v1/chat/completions" type Attempt struct { Tenant string ID string Rubric string CostMicrousd *int64 RubricValid bool } type Summary struct { Tenant string `json:"tenant"` Endpoint string `json:"endpoint"` Attempts int `json:"attempts"` RubricValid int `json:"rubric_valid"` UnknownAmounts int `json:"unknown_amounts"` KnownCostMicrousd int64 `json:"known_cost_microusd"` } func same(a, b Attempt) bool { if a.Tenant != b.Tenant || a.ID != b.ID || a.Rubric != b.Rubric || a.RubricValid != b.RubricValid { return false } if a.CostMicrousd == nil || b.CostMicrousd == nil { return a.CostMicrousd == nil && b.CostMicrousd == nil } return *a.CostMicrousd == *b.CostMicrousd } func main() { knownZero := int64(0) first := Attempt{"studio-ember", "sample-a", "gameplay-r3", &knownZero, true} pending := Attempt{"studio-ember", "sample-b", "gameplay-r3", nil, false} records := []Attempt{first, pending, first} seen := make(map[string]Attempt) totals := make(map[string]*Summary) order := []string{} for _, a := range records { if a.Tenant == "" || a.ID == "" || a.Rubric == "" { log.Fatal("missing attribution") } if previous, exists := seen[a.ID]; exists { if !same(previous, a) { log.Fatal("conflicting attempt record") } continue } seen[a.ID] = a s := totals[a.Tenant] if s == nil { s = &Summary{Tenant: a.Tenant, Endpoint: chatEndpoint} totals[a.Tenant] = s order = append(order, a.Tenant) } s.Attempts++ if a.RubricValid { s.RubricValid++ } if a.CostMicrousd == nil { s.UnknownAmounts++ } else { s.KnownCostMicrousd += *a.CostMicrousd } } encoder := json.NewEncoder(os.Stdout) for _, tenant := range order { if err := encoder.Encode(totals[tenant]); err != nil { log.Fatal(err) } } } The summary reports 2 attempts, 1 rubric-valid assessment, and 1 unresolved amount. A repeated delivery does not inflate those counts. That is a ledger property, not an assertion that repeated inference requests are free or automatically deduplicated by every provider. In a deployed version, persist ownership before dispatch, use globally unique application attempt identifiers, and distinguish a duplicate accounting delivery from an intentional new scoring attempt.
This program processes a snapshot. A reconciliation update needs an explicit state transition, so replacing an unresolved amount with a resolved one should be a transactional update rather than a conflicting second insert. Durable storage, bounded numeric handling, and reconciliation deadlines belong in the production design; the small example demonstrates the accounting distinction without claiming to implement that entire system.
References
The source links below support inspecting conversation interfaces and their integration boundaries. They do not establish a comparative hiring-quality result. The WebRTC reference concerns browser real-time communication; it is useful for identifying a separate transport decision, not for proving that a text chatbot includes a voice service.
Close the alert loop by testing thresholds against normal recruiting bursts before attaching a pager. A tenant can legitimately schedule many interviews together, and usage records can be unresolved briefly while reconciliation proceeds; paging on every such record would spend the on-call's attention without identifying a budget decision. Group alerts by tenant, attach the age and count of unresolved attempts, and escalate against the studio's chosen reconciliation SLO. Keep the known spending threshold separate. Set either threshold too aggressively and the false positives will compete with actual scoring interruptions for the same engineer's attention.