Skip to content

Concepts

Four concepts underpin everything in Athena. Understanding them makes the API predictable.


Workspace

A workspace is the tenant boundary. Every agent, user, credit ledger, and CMS page belongs to one workspace.

A workspace has human members with roles (Owner, Admin, Member, Guest) and exposes two classes of API key:

Key typePrefixLifetimeUse
Workspace API Keywak_Long-livedServer-side only. Never expose to clients.
Ephemeral API Keyeak_1 min – 24 hSafe for client devices. Issued per session.

API-key requests carry the workspace’s raw UUIDv7 in X-Workspace-Id to identify the tenant.


Agent

An agent is a published workflow with attached metadata: system prompt, model selection, tool configuration, and a storefront description.

Agents are versioned. Your app references an agent by its raw UUIDv7. It never needs to know the underlying workflow structure.

Agents can execute in three modes:

ModeEndpoint suffixUse
Sync/executeShort workflows, server-to-server
Streaming/execute/streamReal-time SSE token stream to the client
Batch/execute/batchMultiple inputs in a single request

Execution

An execution is one run of an agent. It holds:

  • Message history and conversation scope
  • Workflow state (the BFS node queue and variables)
  • Credit transactions (pre-deduct, reconcile)
  • A resumable checkpoint in Redis

Executions can pause mid-flight and resume later. The three pause states are:

StateCauseHow to resume
AwaitingApprovalHumanGate node waiting for a human decisionPOST /executions/{id}/resume
WaitingForExternalEventMediaGeneration node waiting for a Fal.ai webhookAutomatic — webhook triggers resume
AwaitingClientToolLLM emitted a client tool callPOST /executions/{id}/tool-result

External Customer

An external customer is your end-user — identified by a Firebase UID, Clerk user ID, or any opaque string your auth system provides.

Athena tracks per-customer:

  • Credit balance — subscription bucket (resets on renewal) and consumable bucket (permanent top-ups)
  • Conversation history — all executions within a conversation scope
  • Generated media — images and videos produced by agents

How They Relate

Workspace
├── wak_ keys (server-side)
├── eak_ keys (per session)
├── Agents
│ └── Executions
│ └── belongs to an External Customer (optional)
└── External Customers
├── credit ledger
└── conversation history

Next Steps