API Authentication
Twexapi uses Bearer token authentication to secure all API requests. Each request must include a valid API key in the Authorization header to access our endpoints.Getting Your API Key
Follow these simple steps to obtain your API key:- Sign in to your Twexapi Dashboard
- Your unique API key will be displayed prominently on the dashboard homepage
- Copy the key securely - you’ll need it for all API requests
Using Your API Key
Include your API key in theAuthorization header of every request using the Bearer token format:
Required Header:
Authenticate with AI Coding Agents
Install the TwexAPI skill so Cursor, Claude Code, GitHub Copilot, ChatGPT, Cline, Windsurf, Codex, Gemini CLI, Continue, Roo Code, and other AI assistants know how to attach Bearer tokens correctly. Setup guides and CLI options are on the integrations hub..env file”, “add Bearer authentication to this API client”, or “generate a test request with my API key”.
Implementation Examples
Here are practical examples showing how to authenticate your requests across different programming languages:Replace
YOUR_API_KEY with your actual API key from the dashboard. All examples fetch user information for demonstration purposes.cURL
Perfect for testing and quick API exploration:Python
Using the popularrequests library:
JavaScript (Node.js/Browser)
Modern fetch API implementation:Java
Using Unirest for simplified HTTP requests:Best Practices
- Environment Variables: Store your API key in environment variables, never hardcode it
- Error Handling: Always implement proper error handling for API responses
- Rate Limiting: Respect API rate limits to avoid service interruptions
- HTTPS Only: All requests must use HTTPS for security