API reference

Errors

When an AI request fails, rNet returns an HTTP error status and a JSON body.

Error format

json
{
  "message": "Insufficient funds",
  "error": "Insufficient funds",
  "errorCode": 402
}

errorCode repeats the HTTP status. The SDKs turn this into an exception with the message Request failed: 402 - Insufficient funds.

Status codes

StatusMessageCause and fix
400Access token is requiredNo access_token query parameter.
400Access token is malformedThe token is not a valid rNet access token.
400Invalid model accessNo model query parameter.
400Invalid JSON bodyThe body is not valid JSON.
401Access token has expiredRefresh the token and retry. See Sessions.
401Access token signature is invalidThe token was not issued by rNet. Sign the user in again.
402Insufficient fundsThe user is out of credits. Ask them to top up in their Credit Wallet.
422Invalid model accessThe model ID is unknown or not available. Check Models.
429Rate limit exceeded.Too many requests. Wait and retry. See Rate limits.
500Billing … / internal errorSomething went wrong at rNet. Retry later.
Other 4xx/5xxThe provider's errorThe model provider rejected the request (for example an invalid body). The status is passed through; 502 if the provider could not be reached.