Resources

Errors

The API uses conventional HTTP status codes and returns a JSON error object with a stable type you can branch on. Messages are for humans and may change; types will not.

#The error object

402 Payment Required
{
  "error": {
    "type": "insufficient_funds",
    "message": "Wallet balance 3.5 is below 5.",
    "hint": "Top up the wallet or lower the amount.",
    "doc_url": "https://docs.synergetics.ai/errors#insufficient_funds"
  }
}
FieldDescription
typeMachine-readable error type. Safe to branch on.
messageHuman-readable explanation. Do not parse it.
hintOptional. What to try next.
doc_urlLink to this page, anchored at the error type.

#HTTP status codes

CodeMeaning
200Success.
400The request was malformed or missing a required field.
401Missing or invalid API key, or an expired credential or session.
402The wallet cannot cover the payment.
403Understood but refused: revoked credential, untrusted issuer, or a mandate limit.
404The object or endpoint does not exist.
409The request conflicts with the object’s state, such as pending KYA.
429Too many requests. Back off and retry.
5xxSomething went wrong on our side. Safe to retry with backoff.

#Error types

TypeStatusWhat it means
missing_parameter400A required field was absent.
invalid_parameter400A field was present but malformed, such as a non-positive amount or an agent name with uppercase letters.
invalid_api_key401The Authorization header is missing, malformed, or holds a revoked key.
credential_expired401The presented credential is past its expires_at. Issue a new one.
session_expired401The AgentTalk session token has expired. Open a new session.
insufficient_funds402The wallet balance is below the requested amount.
agent_revoked403The credential was revoked by its issuer. This is the kill switch firing.
untrusted_issuer403The credential is valid but its issuer is not in your trust policy.
mandate_exceeded403The payment breached a limit the owner signed. Lower the amount or update the mandate.
agent_not_found404No agent with that AgentID.
credential_not_found404No credential with that id.
wallet_not_found404No wallet with that id.
session_not_found404No session with that id.
name_not_found404No agent is registered under that .twin name.
unknown_endpoint404No route for that method and path. Check the API reference.
kya_pending409Know Your Agent verification has not completed for this agent.
rate_limit_exceeded429Too many requests for this key.

#Retrying requests

Retry only when the error is transient. Retrying a 4xx other than 429 returns the same error.

  • Retry 429 and 5xx with exponential backoff and jitter.
  • Do not retry 400, 401, 403 or 404. Fix the request instead.
  • Re-establish on credential_expired and session_expired: issue a new credential or open a new session, then retry once.
import random
import time
import requests

RETRYABLE = {429, 500, 502, 503, 504}

def call(method, url, **kwargs):
    for attempt in range(5):
        res = requests.request(method, url, **kwargs)
        if res.status_code not in RETRYABLE:
            break
        time.sleep(min(2 ** attempt, 30) + random.random())
    if not res.ok:
        err = res.json()["error"]
        raise RuntimeError(f"{err['type']}: {err['message']}")
    return res.json()

Payments that fail with mandate_exceeded or insufficient_funds never touch the ledger, so there is nothing to roll back.

Last updated 5 October 2026llms.txt · synergetics.ai · © Synergetics.ai