Documentation

Auth, Retries & Timeout

API authentication methods and reliable request settings

1 min read

Many APIs require authentication, and networks are sometimes unreliable. Layerz provides various authentication methods, along with retry and timeout settings to guard against failures.

Auth

  • None — No authentication
  • Bearer Token — Sends a token in the header
  • Basic — Username/password based
  • API Key — Sends a key in the Header or Query
  • OAuth 2.0 — Client Credentials grant. The received token is cached in memory.

You can use binding tokens in auth values too, so a token or key can be pulled from project data.

Retries and Timeout

  • Timeout — If a request exceeds this time, it's treated as a failure.
  • Max Retries — The maximum number of times to retry on failure
  • Retry Delay — The interval between retries (grows progressively with exponential backoff)

Retries happen for timeouts, connection errors, and 408/429/5xx responses. This keeps things working reliably even during temporary network problems or server congestion.

When practicing with public test APIs, authentication is often None. When you connect a real service API, be sure to configure the authentication method and retries together.