Skip to main content

Authentication Methods

AgentWallex supports two authentication methods:

API Key Authentication

API keys are the recommended approach for server-side and SDK integrations. Every key starts with the awx_ prefix.
Never expose your API key in client-side code, public repositories, or logs. Always load it from environment variables.

Environment Variables

Store your API key as an environment variable:

JWT Bearer Token Authentication

For web applications and OAuth flows, use JWT bearer tokens. Tokens are obtained through the Google OAuth flow:
1

Start OAuth flow

Redirect the user to the Google OAuth endpoint:
2

Handle callback

After authentication, Google redirects to your callback URL with a one-time code:
3

Exchange for tokens

Exchange the one-time code for access and refresh tokens:
4

Use the access token

Include the access token in the Authorization header:

Refreshing Tokens

Access tokens expire. Use the refresh token to obtain a new access token:

Logout

Invalidate the current session:

Security Best Practices

Follow these practices to keep your integration secure.
  • Use environment variables — Never hardcode API keys in source code.
  • Rotate keys regularly — Rotate API keys at least every 90 days. See API Keys for rotation instructions.
  • Use the minimum scope needed — Create separate API keys per environment (sandbox vs. production).
  • Enable IP allowlisting — Available on Growth and Enterprise plans to restrict API access to known IPs.
  • Monitor audit logs — Review authentication events in the dashboard or via GET /audit-logs.
  • Use sandbox for development — Never test with production keys or real funds.