Skip to main content
POST
/
api
/
admin
/
api-keys
Generate API Key
curl --request POST \
  --url https://api.ai2fin.com/api/admin/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "MCP Inspector - Production",
  "scopes": [
    "mcp:read",
    "mcp:tools:list"
  ],
  "expiresInDays": 90
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "name": "<string>",
    "key": "<string>",
    "scopes": [
      "<string>"
    ],
    "expiresAt": "<string>",
    "createdAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

JWT token obtained from /api/auth/login endpoint. Use for standard API access and OAuth-based integrations.

Body

application/json
name
string
required
Example:

"MCP Inspector - Production"

scopes
enum<string>[]
required
Available options:
mcp:read,
mcp:tools:list,
mcp:tools:call,
mcp:resources:read,
mcp:full,
*
Example:
["mcp:read", "mcp:tools:list"]
expiresInDays
integer
default:90
Example:

90

Response

API key created

success
boolean
data
object