Documentation

Learn how to use ae.app, from API calls to CLI integration.

Authentication

ae.app uses different authentication methods depending on how you interact with the platform. Whether you are building an application, using the CLI, or managing your dashboard, there is an authentication method for you.

API Keys (For Applications)

For server-side applications making calls to the proxy, use API key authentication. You can generate an API key from the developer dashboard under Settings > API Keys.

Include your API key in the Authorization header as a Bearer token:

Authorization: Bearer ae_live_abc123...

API keys are scoped to your account and inherit your plan's quotas and rate limits. You can create multiple keys and revoke them individually.

JavaScript Example

const response = await fetch(
  "https://api.ae.app/v1/call/coingecko/prices/simple/price?ids=bitcoin,ethereum&vs_currencies=usd",
  { headers: { "Authorization": "Bearer ae_live_abc123..." } }
);

const data = await response.json();
console.log(data); // { bitcoin: { usd: 67000 }, ethereum: { usd: 3500 } }

cURL Example

curl "https://api.ae.app/v1/call/open-meteo/forecast/v1/forecast?latitude=40.71&longitude=-74.00&current=temperature_2m" \
  -H "Authorization: Bearer YOUR_AE_API_KEY"

Device Flow (For CLI)

The CLI uses OAuth Device Authorization Flow to securely authenticate without managing API keys manually. This is the recommended method for developer tools and local environments.

  • Run ae auth login in your terminal
  • You will be given a device code and a URL
  • Open the URL in your browser and confirm the login
  • The CLI will automatically receive a short-lived access token
  • Tokens are stored locally (refresh is not yet automated — re-run login if expired)
$ ae auth login

Open this URL in your browser:

  https://ae.app/authorize

Enter code: ABCD-1234

Waiting for authorization...
✓ Logged in successfully!

To check your current authentication status or log out:

ae auth status   # Check who you're logged in as
ae auth logout   # Clear stored credentials

Session Auth (For Web)

The ae.app dashboard uses session-based authentication powered by Better Auth. When you sign in through the web interface, a secure HTTP-only cookie is set to maintain your session.

  • Cookies: Secure, HTTP-only, SameSite=Lax
  • Session duration: 7 days, refreshed on activity
  • Endpoints: All session auth flows use /api/auth/*

Session auth is used exclusively for the dashboard UI. Do not use session cookies for proxy API calls — use API keys instead.

Security tip: Never expose your API key in client-side code. Use environment variables on your server and proxy requests from your backend.

See Also