Python SDK methods for Keys operations
Method | HTTP request | Description |
---|---|---|
create_api_key | POST /api_keys | Create API Key |
delete_api_key | DELETE /api_keys/ | Delete API Key |
generate_api_key | POST /api_keys/generate | Generate API Key |
get_api_keys | GET /api_keys | Get API Keys |
CreateApiKeyResponse create_api_key(create_api_key_request)Create API Key Create a new API key with a user-provided public key. This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA public key. The platform will use this public key to verify signatures on API requests.
Name | Type | Description | Notes |
---|---|---|---|
create_api_key_request | CreateApiKeyRequest |
Status code | Description |
---|---|
201 | API key created successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
403 | Forbidden - insufficient permissions |
500 | Internal server error |
delete_api_key(api_key)Delete API Key Delete an existing API key. This endpoint permanently deletes an API key. Once deleted, the key can no longer be used for authentication. This action cannot be undone.
Name | Type | Description | Notes |
---|---|---|---|
api_key | str | API key ID to delete |
Status code | Description |
---|---|
204 | API key successfully deleted |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
GenerateApiKeyResponse generate_api_key(generate_api_key_request)Generate API Key Generate a new API key with an automatically created key pair. This endpoint generates both a public and private RSA key pair. The public key is stored on the platform, while the private key is returned to the user and must be stored securely. The private key cannot be retrieved again.
Name | Type | Description | Notes |
---|---|---|---|
generate_api_key_request | GenerateApiKeyRequest |
Status code | Description |
---|---|
201 | API key generated successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetApiKeysResponse get_api_keys()Get API Keys Retrieve all API keys associated with the authenticated user. API keys allow programmatic access to the platform without requiring username/password authentication. Each key has a unique identifier and name.
Status code | Description |
---|---|
200 | List of API keys retrieved successfully |
401 | Unauthorized - authentication required |
500 | Internal server error |