Basic Information

appmixer.unkey.core.CreateKey

1.0.0

Public

Create a new API key in Unkey. You can specify properties like prefix, metadata, rate limits, and expiration.

Input Ports

in

FieldTypeDescription
API ID text The ID of the API this key belongs to
Key Prefix text Optional prefix for the key (e.g., 'sk')
Key Name text A name to identify the key
Byte Length number Length of the key in bytes (16-255, default: 16). Higher values increase security.
External ID text Your system's identifier for the user/entity. Returned during verification for user identification.
Metadata (JSON) textarea JSON object with custom metadata returned during verification. Avoid sensitive data.
Roles (JSON array) textarea JSON array of role names to assign (e.g., ["admin", "editor"]). Roles must exist in workspace.
Permissions (JSON array) textarea JSON array of permissions (e.g., ["documents.read", "documents.write"]). Supports wildcards.
Expires date-time Date and time when the key will expire. Omit for permanent keys.
Rate Limits (JSON array) textarea JSON array of rate limit objects with name, limit, duration (ms), and autoApply fields.
Credits (JSON) textarea JSON object for usage-based limits with 'remaining' (required) and 'refill' (optional) fields. Controls total usage with global consistency.
Enabled toggle Whether the key is active immediately upon creation
Recoverable toggle Store plaintext key in encrypted vault for later retrieval. Only enable if absolutely necessary.

Output Ports

out

FieldTypeDescription
Key ID -
Key -

Full Metadata