API Authentication
Different Stru AI APIs use different authentication methods. This guide covers authentication requirements for each API.Memory API Authentication
The Memory API requires an API key passed in theX-API-Key request header. Get your API key from app.stru.ai.
Required Header
Example Request
cURL
Python
JavaScript
Get your Memory API key from app.stru.ai. Keep your API key secure and never expose it in client-side code.
Other APIs (Search, Mathcad, Excel)
These APIs require Bearer token authentication with an API key from app.stru.ai.Required Header
Example Request
cURL
Python
JavaScript
Get your API key by signing in to app.stru.ai and generating a key from your dashboard.
Blogs API (Internal Only)
The Blogs API uses internal proprietary authentication and is restricted to internal use only. Base URL:https://api.stru.ai (no /v1)
Authentication: API key (handled internally by the backend)
Blogs API endpoints are not available for external use. Authentication is managed through internal systems. Contact the Stru AI team if you need access for integration purposes.
Best Practices
Secure Your API Keys
Secure Your API Keys
- Never commit API keys to version control
- Use environment variables for API keys
- Rotate keys regularly
- Use different keys for development and production
Handle Authentication Errors
Handle Authentication Errors
Always handle authentication failures gracefully:
Use HTTPS Only
Use HTTPS Only
All Stru AI APIs are HTTPS-only. Never use HTTP for API requests as it exposes your API keys.✅
https://memory.stru.ai
❌ http://memory.stru.aiError Responses
401 Unauthorized
Missing or invalid API key.403 Forbidden
Valid API key but insufficient permissions.Getting API Keys
1
Sign in to Stru AI
Visit app.stru.ai and sign in to your account.
2
Navigate to API Keys
Go to your dashboard and find the API Keys section.
3
Generate a Key
Click “Generate New API Key” and save it securely. Keys start with
sk_live_...4
Use in Requests
Add the key to your requests as a Bearer token.
Memory API: Uses the same API key system. Get your Memory API key with
X-API-Key header format from your dashboard.Rate Limits
Memory API
Recommended: Max 100 requests/minute per API key
Search API
Limit: 120 requests/minute (Pro tier)Varies by subscription tier
Mathcad & Excel
Limit: 60 requests/minute (Pro tier)Varies by subscription tier
Rate limits are enforced per API key. Exceeded limits return a
429 Too Many Requests error with retry-after headers:X-RateLimit-Limit- Your rate limitX-RateLimit-Remaining- Requests remainingX-RateLimit-Reset- Time when limit resets