100 free credits. No credit card required. Get a key

Explain a failed API response

Paste an error body or a status and get what it means, whether a retry can help, and what to do next.

GET /v1/utility/explain-errorBeta0 credits per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/utility/explain-error?status=402",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 0 credits
{
"status": 402,
"code": null,
"message": null,
"hint": null,
"details": null,
"retryable": false,
"charged": false,
"explanation": [
{
"code": "payment_required",
"status": 402,
"retryable": false,
"what_to_do": "No key and no payment: answer the WWW-Authenticate (MPP) or PAYMENT-REQUIRED (x402) challenge, or sign up free for a key…"
},
{
"code": "payment_failed",
"status": 402,
"retryable": false,
"what_to_do": "The payment credential was refused (invalid, expired, already used or not settled). Get a fresh challenge by retrying wi…"
},
"… 2 more"
],
"request": null,
"note": "A failed call is never charged. Branch on error.code, not on the message."
}

Parameters

NameTypeDescription
statusqueryintegerThe HTTP status. Example: 402.
bodyquerystringThe response body.
requestquerystringThe request you made (echoed).
Status codes
StatusMeaning
200What the error means and what to do.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No such endpoint, recipe or platform.
429Too many requests. Wait for Retry-After seconds.
503Utility is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Does it cost anything?

No. Discovery endpoints are free and need no API key, so an agent can look around before it signs up.

Reddit, X and every other platform named here are trademarks of their owners. We are not affiliated with or endorsed by any of them.