This document provides a comprehensive guide on how to generate, view, and manage API keys for the Alchemyst AI platform using the available API endpoints.
Example header: ```json "Authorization": "Bearer YOUR_JWT_TOKEN" ```
Generate a new API key by making a POST request to:
POST /api/v1/settings/api-keys/newRequest Body (optional): You may provide an optional "name" for your API key.
Example Request Body: ```json { "name": "My Integration Key" } ```
Response: ```json { "success": true, "apiKey": "your_generated_api_key", "name": "My Integration Key", "status": 201 } ```
Retrieve all API keys associated with your account:
GET /api/v1/settings/api-keys/listResponse: ```json { "success": true, "apiKeys": [ { "apiKey": "your_api_key_1", "creator": "user123", "createdAt": "2024-12-24T12:00:00Z" }, ... ] } ```
To delete an API key, send a POST request with the API key you wish to remove:
POST /api/v1/settings/api-keys/deleteRequest Body: ```json { "apiKey": "your_api_key_to_delete" } ```
Response: ```json { "success": true, "message": "Entry deleted." } ```
To validate that your current authentication allows API key operations and retrieve related organization details, use:
GET /api/v1/settings/api-keys/validateResponse: ```json { "user": { /* user information / }, "organization": { / organization details */ } } ```
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/settings/api-keys/new |
POST | Create a new API key |
/api/v1/settings/api-keys/list |
GET | List API keys owned by the authenticated user |
/api/v1/settings/api-keys/delete |
POST | Delete a specified API key |
/api/v1/settings/api-keys/validate |
GET | Validate API key permissions and fetch details |
/api/v1/settings/api-keys/new.