CometAPI fallback runbook for chat completions: monitoring signals checklist for 2026-05-08
Last reviewed: 2026-05-08
This draft is for teams building reliability controls around CometAPI chat completions. It focuses on signals to monitor before, during, and after fallback decisions. For broader reliability patterns, see the site index at /sites/llm-api-reliability/ and the article archive at /sites/llm-api-reliability/posts/.
The CometAPI public documentation provides the main API reference entry point at apidoc.cometapi.com and a specific API reference page at api-13851472. Because endpoint details, request fields, authentication requirements, and response formats can change, treat this runbook as an operational checklist and verify implementation details against the current CometAPI docs before release.
Key takeaways
- Build fallback around measurable symptoms: elevated latency, timeout rate, transport errors, API errors, invalid responses, and budget-risk signals.
- Do not trigger fallback from one failed request alone unless the workflow is latency-critical and the retry policy has already been exhausted.
- Keep thresholds configurable. Example values in this article are starting points to tune against your own traffic, SLOs, and customer impact.
- Preserve request IDs, provider/model route, status code, latency, retry count, token estimate, and fallback reason in logs.
- Validate fallback in staging with synthetic failures before enabling automated production routing.
- Re-check CometAPI’s API reference and Help Center before changing payloads, authentication, or operational assumptions.
Concise definition
A chat completions fallback runbook is an operational procedure that decides when a chat completion request should be retried, rerouted, degraded, queued, or failed safely based on monitored reliability signals.
For CometAPI integrations, the runbook should be anchored to the current CometAPI API documentation, including the public documentation home page and endpoint-specific reference pages such as https://apidoc.cometapi.com/api-13851472.
Scope
Use this checklist when your application sends chat completion requests through CometAPI and needs predictable behavior during:
- transient upstream errors,
- request timeouts,
- elevated tail latency,
- malformed or unexpected responses,
- rate-limit or quota-like conditions,
- high-cost or high-token prompts,
- model or route degradation,
- partial outages in dependent systems.
This article does not claim current CometAPI pricing, model availability, guaranteed uptime, benchmark rank, or guaranteed fallback behavior. Confirm product-specific behavior in the official API documentation and Help Center at https://apidoc.cometapi.com/help-center.
Monitoring signals checklist
1. Request health signals
Track every chat completion request with these fields:
| Signal | Why it matters | Suggested action |
|---|---|---|
request_id | Correlates app logs, gateway logs, and user impact | Generate one if not returned by the API layer |
route_name | Shows which model/provider route handled the request | Required for fallback debugging |
status_code | Separates transport success from API failure | Alert on sustained error-rate increase |
error_type | Distinguishes timeout, auth, validation, rate-limit, and server errors | Route only retryable errors to fallback |
latency_ms | Detects slow responses before hard failures | Alert on p95/p99 drift |
timeout_ms | Confirms whether client timeout is realistic | Tune by workflow |
retry_count | Prevents retry storms | Cap retries per request |
fallback_used | Shows when fallback was activated | Review volume daily during rollout |
fallback_reason | Explains why routing changed | Required for incident review |
response_parse_ok | Detects malformed or unexpected response shape | Fallback or fail closed depending on workflow |
Example thresholds: alert if the five-minute error rate exceeds 2% for production traffic, or if p95 latency is more than 2x the normal baseline. These are examples to tune, not universal values.
2. Latency signals
Monitor at least:
- p50 latency,
- p95 latency,
- p99 latency,
- timeout rate,
- queue time if your gateway queues requests,
- time to first byte if streaming is used,
- total completion duration.
Fallback trigger examples:
- p95 latency remains above your SLO for three consecutive evaluation windows.
- Timeout rate exceeds a tuned percentage for a critical workflow.
- Time to first byte rises while total completion duration remains unstable.
Avoid a single global timeout for all requests. Short interactive chats, background summarization jobs, and long-context analysis calls usually need different timeout budgets.
3. Error classification signals
Classify errors before triggering fallback.
Recommended categories:
client_validation_error: payload shape, missing required field, invalid role/message format.authentication_error: missing or invalid credentials.authorization_error: key or account lacks required access.rate_limit_or_quota_error: request blocked due to limit-like condition.timeout_error: client timeout or gateway timeout.server_error: upstream 5xx-like failure.network_error: DNS, TLS, connection reset, or no response.parse_error: response returned but did not match expected schema.policy_or_safety_error: request refused or blocked by policy-like behavior.
Fallback should generally target retryable categories such as timeout, network, selected server errors, and selected route degradation. Do not use fallback to hide persistent client-side validation errors.
4. Response quality and schema signals
For structured or tool-like workflows, fallback should not only monitor HTTP success.
Validate:
- response object exists,
- expected text field or message field is present,
- role and content shape match your parser,
- JSON output is parseable when JSON was required,
- required keys exist,
- output length is within expected bounds,
- refusal or empty response handling is explicit,
- unsafe default values are not silently accepted.
If your business workflow depends on structured output, treat malformed output as a separate reliability signal. A 200-class response can still fail the application.
5. Token and budget-risk signals
For each request, record:
- estimated input tokens before sending,
- configured maximum output tokens,
- observed output length,
- total estimated tokens,
- route/model selected,
- user/account/workspace budget bucket,
- fallback route budget class.
Fallback can accidentally increase cost or latency if the fallback route uses a larger context, longer generation, or less restrictive output cap. Keep token limits and fallback route selection explicit.
Example budget controls to tune:
- Reject or summarize prompts above a configured token estimate.
- Use a lower-cost fallback route only for non-critical workflows.
- For high-value workflows, allow fallback only once per request.
- Emit an alert if fallback traffic exceeds a configured share of total traffic.
Fallback decision ladder
Use a ladder so your system does not jump directly from one failed request to broad rerouting.
Step 1: Validate before send
Before sending to CometAPI, validate:
- request body shape,
- messages array,
- required fields according to the current API reference,
- model or route identifier configured by your application,
- temperature and output length settings,
- timeout configuration,
- idempotency or deduplication key if your architecture uses one.
Check the current API reference at https://apidoc.cometapi.com/api-13851472 before assuming field names or response shape.
Step 2: Retry locally for safe transient failures
Retry only when the operation is safe to repeat.
Suggested retry policy to tune:
- maximum attempts: 2 or 3,
- backoff: exponential with jitter,
- retryable errors: network timeout, selected 5xx-like errors, selected connection errors,
- non-retryable errors: invalid payload, authentication failure, authorization failure.
Do not retry indefinitely. Retry storms can amplify outages.
Step 3: Degrade within the same route
If the request is too large or too slow, consider controlled degradation:
- reduce maximum output tokens,
- summarize long context first,
- disable non-essential formatting,
- skip optional enrichment,
- queue background jobs instead of blocking the user.
Step 4: Fallback to an alternate route
Use alternate route fallback when:
- error rate for the primary route is above the tuned threshold,
- latency SLO is breached for multiple windows,
- parse failures rise for a specific route,
- an incident flag is enabled by operators,
- synthetic probes fail consistently.
Log the fallback reason. Do not silently reroute without observability.
Step 5: Fail safely
If fallback also fails, return a controlled application response:
- preserve user input when possible,
- provide a retry option,
- avoid exposing raw upstream error details,
- mark the request as failed in telemetry,
- create an incident event if the workflow is critical.
Sanitized curl-style example
The example below is intentionally generic. Confirm the exact endpoint path, authentication header, request fields, and response schema in the current CometAPI documentation before using it in production.
curl -X POST “https://YOUR_COMETAPI_BASE_URL/v1/chat/completions”
-H “Authorization: Bearer ${COMETAPI_API_KEY}”
-H “Content-Type: application/json”
-H “X-Request-ID: req_20260508_example_001”
-d ‘{
“model”: “your-configured-chat-route”,
“messages”: [
{
“role”: “system”,
“content”: “You are a concise support assistant.”
},
{
“role”: “user”,
“content”: “Summarize the status of my order using the provided context.”
}
],
“max_tokens”: 300,
“temperature”: 0.2,
“metadata”: {
“workflow”: “support_summary”,
“fallback_policy”: “retry_then_alternate_route”,
“request_budget_class”: “standard”
}
}’
Sanitization notes:
- Replace
YOUR_COMETAPI_BASE_URLwith the base URL from the official CometAPI docs. - Do not place real API keys in source control or logs.
- Treat
modelas an application configuration value. - Do not assume
metadatais supported unless verified in the API reference. - Keep request IDs non-sensitive.
Practical validation steps
Pre-production validation
Documentation check
Open the CometAPI documentation home page at https://apidoc.cometapi.com/ and the relevant endpoint page at https://apidoc.cometapi.com/api-13851472. Confirm the current endpoint, authentication method, required request fields, and response structure.Schema validation test
Send a minimal valid chat completion request in staging. Confirm your parser extracts the response content without fallback.Invalid payload test
Send a deliberately invalid staging request. Confirm it is classified asclient_validation_errorand does not trigger fallback.Timeout test
Configure an artificially low timeout in staging. Confirm the request is classified astimeout_error, retry behavior is capped, and fallback reason is logged.Network failure test
Block outbound traffic from a staging worker or use a controlled fault-injection proxy. Confirmnetwork_errorclassification and safe recovery.Malformed response simulation
Mock a response that is syntactically valid HTTP but missing the expected content field. Confirmparse_errorbehavior is visible and does not corrupt downstream data.Fallback route test
Force the primary route to fail in staging. Confirm the alternate route is used only after the configured retry/degradation steps.Budget guard test
Send a large prompt near your configured token budget. Confirm the application either summarizes, rejects, or routes according to policy.Observability test
Confirm dashboards show request volume, error rate, latency, fallback count, fallback reason, and route-level breakdown.Rollback test
Disable automated fallback with a feature flag. Confirm traffic returns to the primary behavior without redeploying.
Production rollout validation
Start with low-risk traffic.
Suggested rollout sequence:
- Enable logging-only mode for fallback decisions.
- Compare “would fallback” decisions against actual user impact.
- Enable fallback for a small traffic slice or a non-critical workflow.
- Review false positives and false negatives daily during rollout.
- Expand gradually if fallback improves user-visible reliability.
- Keep a manual override for incident commanders.
Alerting checklist
Create alerts for:
- primary route error rate above tuned threshold,
- fallback route error rate above tuned threshold,
- fallback volume above expected baseline,
- p95 or p99 latency above SLO,
- timeout rate increase,
- parse error spike,
- authentication or authorization errors,
- unusual token consumption,
- repeated fallback failure,
- missing telemetry fields.
Alert messages should include:
- affected workflow,
- primary route,
- fallback route,
- start time,
- current error rate,
- current latency,
- recent deploy identifier,
- feature flag state,
- dashboard link,
- runbook link.
For publishing governance and future revisions, keep the editorial source linked from /sites/llm-api-reliability/editorial/.
Incident response checklist
When an incident starts:
- Confirm whether the issue is application-side, network-side, or API-side.
- Check recent deploys and configuration changes.
- Compare primary route and fallback route error rates.
- Check whether fallback is reducing or amplifying user impact.
- If fallback is amplifying errors, disable it with a feature flag.
- If fallback is helping, keep it enabled and watch budget impact.
- Notify support teams with customer-facing language.
- Preserve logs and request IDs for post-incident analysis.
- After recovery, calculate fallback precision: how often fallback was triggered for genuinely retryable failures.
- Update thresholds and tests.
Example dashboard panels
A useful CometAPI chat completions reliability dashboard should include:
- total requests by workflow,
- success rate by route,
- error rate by error category,
- p50/p95/p99 latency,
- timeout count,
- fallback attempts,
- fallback success rate,
- fallback failure rate,
- parse failure count,
- estimated token consumption,
- top workflows by fallback volume,
- recent deploy overlay,
- incident flag state.
FAQ
Should every failed chat completion request trigger fallback?
No. First classify the failure. Invalid payloads, authentication errors, and authorization errors usually require configuration or code fixes, not fallback. Fallback is most useful for transient or route-specific reliability failures.
What thresholds should I use?
Use thresholds based on your own baseline and SLO. Example thresholds such as 2% error rate or 2x normal p95 latency are starting points only. Tune them against workflow criticality, traffic volume, and user impact.
Should fallback use the same prompt?
Usually yes, but keep safety and budget controls. If the prompt is too large or too expensive, summarize or truncate according to a documented policy before fallback.
Should fallback be automatic or manual?
Use both. Automatic fallback can protect high-volume workflows from transient failures. Manual controls are still needed during incidents, unexpected cost spikes, parser regressions, or vendor/API behavior changes.
How do I avoid retry storms?
Cap retries, use exponential backoff with jitter, classify non-retryable errors, and add circuit breakers. Monitor retry count and fallback count separately.
Can I rely on this article for exact CometAPI endpoint fields?
No. This article is an operational runbook. Confirm exact request fields, authentication, endpoint paths, and response schema in the current CometAPI API reference, including https://apidoc.cometapi.com/api-13851472.
Sources checked
- CometAPI API documentation home — Accessed 2026-05-08. Purpose: verify the official public documentation entry point for CometAPI API integration details.
- CometAPI API reference page — Accessed 2026-05-08. Purpose: identify the relevant endpoint-specific documentation location to validate chat completions implementation details.
- CometAPI Help Center — Accessed 2026-05-08. Purpose: identify where operational, account, or support guidance may be confirmed before production rollout.