Authentication Methods
Vibing AI supports the following authentication methods:- OAuth 2.1 - For user-authenticated requests
- API Keys - For service-to-service requests
- Session Tokens - For web/mobile client requests
OAuth 2.1
OAuth 2.1 is the recommended authentication method for applications that need to access user data or perform actions on behalf of users.OAuth Flow
-
Authorization Request
Redirect the user to the Vibing AI authorization URL:
Parameters:
response_type: Always set tocodeclient_id: Your application’s client IDredirect_uri: URL to redirect after authorizationscope: Space or plus-separated list of requested scopesstate: Random string to prevent CSRF attacks
-
Authorization Response
After user approval, they will be redirected to your
redirect_uriwith a code: -
Token Exchange
Exchange the authorization code for access and refresh tokens:
Response:
-
Token Refresh
When the access token expires, use the refresh token to get a new one:
Using OAuth Tokens
Include the access token in theAuthorization header:
API Keys
API keys are used for service-to-service authentication where user context is not required.Generating API Keys
API keys can be generated in the Vibing AI Developer Portal:- Go to https://developers.vibing.im
- Navigate to API Keys section
- Click “Generate New Key”
- Select scopes and permissions
- Copy and securely store the key
Using API Keys
Include the API key in theX-API-Key header:
Session Tokens
Session tokens are used for web and mobile clients after user login.Obtaining Session Tokens
Session tokens are obtained by authenticating with username and password:Using Session Tokens
Include the session token in theX-Session-Token header:
SDK Authentication
The Vibing AI SDK provides simplified authentication methods:Security Best Practices
-
Store tokens securely
- Never expose client secrets in client-side code
- Use secure storage for tokens
- Clear tokens when no longer needed
-
Implement proper scopes
- Request only the permissions you need
- Explain to users why each permission is needed
-
Handle token expiration
- Implement token refresh logic
- Gracefully handle authentication failures
-
Secure your redirect URI
- Use HTTPS for all redirect URIs
- Validate state parameter to prevent CSRF
-
Protect API keys
- Do not include API keys in client-side code
- Rotate keys periodically
- Use different keys for development and production
Rate Limiting
Authentication requests are subject to rate limiting:- OAuth token requests: 10 requests per minute per client
- API key requests: 5 requests per second per key
- Login attempts: 5 attempts per minute per IP address
Next Steps
- Permissions API - Learn how to manage permissions
- Memory API - Access the Unified Memory System
- Error Handling - Handle authentication errors