Skip to main content

API Key Authentication

All Open API requests require a Bearer token:
Authorization: Bearer osk_megamart_a1b2c3d4e5f6g7h8...

Creating an API Key

Prerequisites

  • Tenant admin role required
  • Open API must be enabled for the tenant by the system administrator

Steps

  1. Log in to the tenant page as an admin
  2. Click Open API in the profile menu
  3. Click Create API Key
  4. Enter a key name and select an expiration period
  5. Copy the generated key to a safe location
The API key is shown only once at creation time. It cannot be retrieved later.

Expiration Options

OptionUse Case
7 daysTesting/development
14 daysShort-term projects
30 daysDefault
60 / 90 daysMedium-term
180 / 365 daysLong-term production
Never expiresPermanent keys

Key Format

osk_{tenant_code}_{random_hex_64}

Key Management

Revoking a Key

Revoke unused keys immediately via the Open API page.
Revoked keys are immediately unusable and cannot be restored.

Key States

StateDescription
ActiveNormal operation
ExpiredPast expiration date (automatic)
RevokedManually revoked

Scopes

ScopeAccessible Endpoints
chat/chat/completions, /models
data_ingest/data/events
analytics/usage
All scopes are enabled by default.

Error Responses

HTTP CodeCause
401Missing key, invalid key, expired key
403Open API disabled for tenant, insufficient scope

Security Best Practices

  • Never include API keys in source code
  • Use environment variables or secret managers
  • Store in iOS Keychain for mobile apps
  • Revoke unused keys promptly