Account & Key Management
Managing your OpenMind Account and API Keys
Your OpenMind account and API keys are used for authentication and authorization in your applications. You can manage your account and keys via the OpenMind portal or directly via an API. The API provides access to the full set of operations (generate, delete, account balance, and key listing).
Base URL: https://api.openmind.com/api/core
Authentication: All endpoints require a JWT token generated with Clerk. Include the token in the Authorization header as a Bearer token.
Endpoints Overview
POST
/api_keys/create
Create a new API key
POST
/api_keys/delete
Delete an existing API key
GET
/account/balance
Get your account balance
GET
/api_keys
List all API keys
Create API Key
Create a new API key for your account. Each plan has a limit on the number of API keys you can create.
Endpoint: POST /api_keys/create
Request
curl -X POST https://api.openmind.com/api/core/api_keys/create \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"Response
Success (200 OK):
Error Responses:
Note: The returned
api_keyis only shown once. Store it securely as you won't be able to retrieve it again.
Delete API Key
Mark an API key as deleted and invalidate it. This action cannot be undone.
Endpoint: POST /api_keys/delete
Request
Request Body
id
string
Yes
The ID of the API key to delete
Response
Success (200 OK):
Error Responses:
Get Account Balance
Retrieve your current OMCU (OpenMind Compute Unit) balance and subscription details.
Endpoint: GET /account/balance
Request
Response
Success (200 OK):
Response Fields
plan
string
Your current subscription plan (e.g., "free", "starter", "pro", "enterprise")
omcu_balance
integer
Total available OMCU credits (monthly + unused prepaid)
monthly_unused_omcu
integer
Unused OMCU credits from your monthly subscription allowance
monthly_total_omcu
integer
Total OMCU credits allocated for the current billing period
current_period_end
string | null
ISO 8601 timestamp of when the current billing period ends
cancel_at_period_end
boolean
Whether the subscription will be cancelled at the end of the current period
Error Responses:
Note: Note the following about your account balance:
omcu_balancerepresents your total available credits, including both monthly subscription credits and any prepaid/unused credits from previous periodsMonthly credits reset at the start of each billing period
Unused prepaid credits do not expire and carry over between billing periods
List API Keys
Retrieve a list of all active API keys for your account.
Endpoint: GET /api_keys
Request
Response
Success (200 OK):
Response Fields
Each API key object contains:
id
string
Unique identifier for the API key
user_id
string
The user ID this key belongs to
name
string
Auto-generated name for the key (format: "api-key-{timestamp}")
prefix
string
The prefix of the API key ("om1_live_" or "om1_test_")
total_cost
integer
Total OMCU credits consumed by this API key
deleted
boolean
Whether the key is deleted (always false in this response)
created_at
string
ISO 8601 timestamp of key creation
updated_at
string
ISO 8601 timestamp of last update
Error Responses:
Note: Note the following about the API keys listed:
Only active (non-deleted) API keys are returned.
The actual secret portion of the API key is never returned in this endpoint.
The
hashed_keyfield is stored in the database but not exposed in the API response for security.
Authentication
All endpoints require authentication using a JWT token issued by Clerk. Include the token in the Authorization header:
Getting Your JWT Token
You can obtain your JWT token through:
OpenMind Portal: Log in at portal.openmind.com and copy your session token
Clerk SDK: Use the Clerk client library to authenticate and retrieve the session token programmatically
Example with Token
Error Handling
All endpoints follow consistent error response patterns:
HTTP Status Codes
200
Success
400
Bad Request - Invalid input parameters
401
Unauthorized - Missing or invalid JWT token
403
Forbidden - Action not allowed (e.g., rate limit reached)
404
Not Found - Resource doesn't exist
500
Internal Server Error - Server-side error
Error Response Format
Rate Limits
API key operations may be subject to rate limits depending on your subscription plan. If you exceed the rate limit, you'll receive a 429 Too Many Requests response.
Last updated
Was this helpful?