Error Codes
A user-friendly reference for API error responses across the AI endpoints.
Common JSON Error Shape
rNet often returns an HTTP 200 OK status even when an error occurs. In these cases, the actual error status is provided inside the JSON response body using the errorCode field:
Your application should always check the errorCode in the response body to determine if the request was successful.
Grouped Error Codes
Each HTTP code appears once, with a clear description and the recommended next step.
| HTTP | Meaning | Description | Recommended Action |
|---|---|---|---|
| 400 | Bad request | The request is missing required data, contains a model name that is not in the supported model list, has a malformed access token, or includes an invalid JSON body. | Check the supported model name, access token, and request body before retrying. |
| 401 | Unauthorized | The access token signature is invalid or the access token has expired. | Ask the user to sign in again or refresh the access token. |
| 402 | Payment required | The account does not have enough available credits for the request, or the billing check failed. | Show a billing message and let the user add credits or choose another account. |
| 404 | Not found | The requested AI model name does not match a supported model route on this server. | Copy a supported model name from the Supported Models page. |
| 422 | Unprocessable request | The request is valid JSON, but the selected supported model cannot process this request body. | Use the provider-specific body shape for the selected supported model. |
| 429 | Too many requests | The request limit has been reached for the current time window. | Wait until the rate-limit window resets, then retry. |
| 500 | Internal server error | The server could not complete an internal verification, billing, usage, or startup step. | Retry later. If it continues, contact rNet support with the request details. |
| 502 | Bad gateway | The server could not connect to the upstream AI provider. | Retry after a short delay or check provider availability. |
Endpoint Notes
/ai uses these errors for non-streaming requests. If the upstream AI provider returns a non-2xx response, rNet passes that provider response through directly.
/ai/stream uses the same pre-start checks before opening the event stream.
Streaming Errors After Start
After HTTP 200 OK and Content-Type: text/event-stream are sent, later failures are delivered as Server-Sent Events because the HTTP status has already been sent:
If the provider fails during the stream, rNet passes through the available chunks and then closes the connection.