Authentication
The Hot runtime API supports three environment-scoped credential types (API Key, Service Key, and Session), while org-level management routes use an Org API Key. All four are passed in the Authorization header as Bearer tokens.
| Credential | Token Format | Lifetime | Purpose |
|---|---|---|---|
| API Key | hot_<uuid>_<secret> | Long-lived | Full or restricted environment access for you and your team |
| Service Key | <uuid>_<secret> | Long-lived (optional expiry) | Permission-scoped access for your customers and integrations |
| Session | s_<uuid>_<secret> | Short-lived (1h default, 24h max) | Ephemeral, permission-scoped access, such as a backend acting for a browser visitor |
| Org API Key | hot_<uuid>_<secret> | Long-lived (optional expiry) | Creating and managing sub-organizations, their environments and API keys |
Sub-organizations own independent environments and deployments. Use a
sub-organization's environment credential to access its resources. A parent
organization's runtime key does not reach its sub-organizations, and
service-key metadata cannot change scope. Administrators of the parent
organization can create org API keys to provision
sub-organizations and mint their environment keys; org keys cannot execute
workflows or call runtime endpoints. Org keys replaced the hm_ management
credentials of Hot 3.0.0, which no longer authenticate.
The API sends no CORS headers: call it from your backend, not from browser code. See Browser Clients and CORS.
curl -H "Authorization: Bearer $TOKEN" https://api.hot.dev/v1/projects
API Keys
API Keys are your primary credentials for accessing the Hot API. Create and manage them from the Hot App dashboard.
- Create keys with descriptive names
- Keys are scoped to environments
- Set an optional expiry when you create a key
- Disable a key and enable it again later
- Rotate a key to issue a new secret, keeping the previous secret working for up to 7 days
- Revoke a key to stop it permanently
Access Levels
When creating or editing an API key, you choose between two access levels:
- Full Access — All runtime API capabilities in the key's environment (the default)
- Restricted — Limit the key to specific capabilities using the permissions model
Service Keys
Service Keys are long-lived, permission-scoped credentials designed for your customers and external integrations. If you're building a platform on Hot Dev and need to give your customers direct API access (e.g., to MCP tools or streams), service keys let you issue narrowly scoped tokens under your API key with granular permissions.
Service keys can carry customer metadata — arbitrary JSON that is encrypted at rest and automatically available to your Hot functions at runtime. This lets you identify callers and pass customer context (e.g., account ID, plan tier) without requiring extra parameters in every request.
Pro plan required. Creating a service key needs a Pro or Scale plan. On another plan the API returns
403with the error codeplan_required. A self-hosted installation without a plan can create them.
Creating Service Keys
From the Hot App, click New Service Key. You'll specify:
- Name — A human-readable label (e.g., "Acme Corp Production")
- Description — What the key is for
- Metadata — Optional JSON attached to the key (e.g.,
{"customer_id": "acme-123"}). Encrypted at rest and available to your Hot functions at runtime viareq.auth.service-key.meta. Use this to pass customer context into your functions without requiring extra parameters. See Caller Identity for details. - Permissions — A granular permission map using the permissions model below.
- Expiration — Optional. Leave empty for a key that never expires.
Resource type restriction: Because service keys are customer-facing, they can only carry permissions for the
mcp,webhook,stream,event, andrunresource types. Arungrant is accepted but has no effect: the run routes take API keys only. Administrative resource types (call,project,build,context,key,session,env,file,blob,domain) and the full-access grant*:*are rejected when creating a service key.
The generated token is displayed only once at creation time. It has no hot_ prefix, making it suitable for white-label integrations where your customers shouldn't see Hot branding.
Managing Service Keys
From the detail view, you can:
- View the key's permissions, metadata, and timestamps
- See when the key was last used
- Revoke the key to immediately invalidate it
Revoked and expired keys remain visible for audit purposes. Service keys can also be managed programmatically via the Service Keys API.
Sessions
Sessions are short-lived tokens with granular permissions. Use them when you need to grant temporary, narrowly scoped access — for example, a backend proxy reading a specific stream on a user's behalf.
Sessions can only be created by API keys (not by other sessions or service keys). The session's permissions must be a subset of the parent API key's permissions.
See the Sessions API for endpoints to create, list, and revoke sessions.
Permissions Model
API keys, service keys, and sessions all share the same permissions model. Permissions are a JSON map of resource URNs to action arrays:
{
"mcp:weather/*": ["execute"],
"event:*": ["create"]
}
| Permission | Format | Description |
|---|---|---|
| Full Access | {"*:*": ["*"]} | Unrestricted access to all API endpoints |
| MCP | {"mcp:*": ["execute"]} | Invoke MCP tools across all services |
| MCP (specific) | {"mcp:weather/*": ["execute"]} | Invoke MCP tools in a specific service only |
| Events | {"event:*": ["create", "read"]} | Publish and read events |
| Builds | {"build:*": ["create", "read", "execute"]} | Upload, read, and deploy builds |
| Context Variables | {"context:*": ["create", "read", "update", "delete"]} | Manage context variables |
| Webhooks | {"webhook:*": ["execute"]} | Access webhook endpoints that require API key authentication |
| Webhooks (specific) | {"webhook:internal/*": ["execute"]} | Webhook access for a specific service only |
A service-specific grant names the service's tools or paths with /*, as in
mcp:weather/* or webhook:internal/*. A bare service name such as
mcp:weather matches no tool or endpoint, so it grants nothing.
An event grant can name a type prefix for publishing, as in
{"event:user:*": ["create"]}. Reading events needs event:*: a narrower
read grant matches no route and grants nothing.
Sessions and service keys can call only the event, stream, task, MCP, and webhook routes. Every other route takes API keys only, whatever a session or service key is granted.
This allows you to create credentials narrowly scoped to just the capabilities needed—useful for giving an AI agent access to specific MCP tools, or restricting a webhook caller to a single service.
Private API routes enforce these permissions too: being an API key does not bypass its grants. See the API permission matrix for administrative resources, collection requirements, file/domain/blob permissions, and the separate permissions required to issue sessions or service keys.
Permissions Builder
When creating or editing a restricted API key or service key, the Hot App dashboard provides an interactive permissions builder instead of requiring manual JSON editing.
Quick Presets — One-click buttons to add common permission rules:
| Preset | Adds |
|---|---|
| Read Only | *:* → read |
| MCP Tools | mcp:* → execute |
| Webhooks | webhook:* → execute |
| Streams | stream:* → read |
| Events | event:* → create, read |
| Runs | run:* → read |
| Build/Deploy | build:* → create, read, execute |
Presets add rules to the builder — they don't replace existing rules.
Rule Builder — Each rule has three parts:
- Resource Type — Select a type from the dropdown (
mcp,webhook,stream,event,run,call,project,build,context,key,session,env,file,blob,domain), orAll (*)for a wildcard that covers every type. - Path — The resource path, usually
*(all resources of that type) or one service's tools or endpoints (e.g.,weather/*; a bareweathergrants nothing). When the resource type isAll (*), the path is locked to*. - Actions — Check one or more actions:
create,read,update,delete,execute, or*(all actions). The available actions depend on the resource type.
Click Add Rule to add additional rules. Rules with no actions checked are silently excluded from the saved permissions.
Stale Service Permissions
Because MCP tools and webhook endpoints are defined by metadata in your source code, a service can be removed when code is redeployed without those definitions. If a credential has a permission referencing a service that is no longer deployed, the key list shows an amber warning badge next to that permission. The edit page displays a banner listing the stale services.
Stale permissions are preserved intentionally—if the service is redeployed, the credential immediately works again without reconfiguration. You can remove stale permissions manually from the edit page if the service is permanently retired.
See the Hot API documentation for the full API reference.