Skip to main content
All API requests require authentication via a Bearer token. API keys identify your account and track credit usage.

Creating an API Key

Create API keys from the Mindcase dashboard:
  1. Navigate to Developer in the left sidebar
  2. Click the API Keys tab
  3. Click + Create Key
  4. Give your key a descriptive name (e.g., “Production Server”)
  5. Copy the key immediately — it will only be shown once
All keys are prefixed with mk_live_ followed by a random string.

Using Your Key

Include the key in the Authorization header of every request:
curl https://api.mindcase.co/api/v1/credits \
  -H "Authorization: Bearer mk_live_abc123def456"

Rate Limiting

Each API key is rate-limited to 60 requests per minute. When you exceed this limit, the API returns a 429 response:
{
  "error": "rate_limit_exceeded",
  "message": "Too many requests. Please wait and retry.",
  "retry_after": 60
}

Error Responses

401 Unauthorized

Returned when the API key is missing, invalid, or revoked.
{
  "error": "unauthorized",
  "message": "Invalid API key. Check your key and try again."
}

402 Payment Required

Returned when your account has insufficient credits.
{
  "error": "insufficient_credits",
  "message": "Not enough credits. You need 50 credits but only have 12.",
  "credits_required": 50,
  "credits_available": 12
}

404 Not Found

Returned when the requested agent or job does not exist.
{
  "error": "not_found",
  "message": "Agent 'instagram/nonexistent' not found."
}

422 Unprocessable Entity

Returned when required parameters are missing or invalid.
{
  "error": "validation_error",
  "message": "Missing required parameter: 'usernames'",
  "details": {
    "field": "usernames",
    "reason": "This field is required"
  }
}