Skip to content

Logs, Monitoring, and Troubleshooting ​

Logs are the first place to look when troubleshooting request issues. It is recommended that the user, application, and platform sides all record the same Request ID, model name, timestamp, and error information.

Which Logs to Check ​

LogPurpose
User request logsAllow users to check the model, Token, usage, errors, and Request ID
Administrator logsView site-wide requests, channels, users, costs, and failure reasons
Channel testsVerify that the upstream Key, Base URL, model, and network proxy are working properly
Performance metricsMonitor latency, failure rate, cache, disk, and system resources
System tasksView the status of background tasks such as log cleanup and model synchronization

Troubleshooting Sequence ​

  1. Confirm whether the request reached the platform.
  2. Check the status code and platform error information.
  3. Locate the model, Token, channel, and upstream response by Request ID.
  4. If it is a permission issue, check the user group, Token restrictions, and whether the model is enabled.
  5. If it is an upstream issue, check the channel Key, balance, proxy, rate limits, and provider status.

Monitoring Recommendations ​

In production environments, continuously monitor request volume, failure rate, average latency, P95 latency, balance, Token consumption, the number of 429 responses, and the number of upstream 5xx responses. For critical services, multiple channels and alerts can be configured.

Alerting Recommendations ​

  • A sudden increase in 401/403 responses within a short period: Check Tokens, account status, and permission configuration.
  • A sustained increase in the proportion of 429 responses: Check concurrency, batch tasks, and quotas.
  • A sustained increase in 502/503/504 responses: Check channel health, upstream status, and proxy network.
  • A sudden increase in P95 latency: Break down metrics by model and channel to avoid looking only at the site-wide average.

Alert notifications should include only the desensitized model, status code, timestamp, and Request ID. Do not send complete API Keys or request bodies.