openapi: 3.0.3 info: title: Albus API description: Albus service REST API version: 1.0.0 servers: - url: https://albus.sh/api/v1 description: Production server - url: http://localhost:8080/api/v1 description: Local development server tags: - name: Agents description: Inspect the agents that have run in your organization. - name: Auth description: Identify the authenticated user. - name: Billing description: Buy the prepaid credits agent sessions run on. - name: Health description: Check service availability. - name: Memories description: Read and delete what your agents remember. - name: Models description: Discover the models available to run agents on. - name: Secrets description: Manage secrets available to agent sessions. - name: Sessions description: Run and inspect agent sessions. - name: Organization description: View and manage the organization you are acting in. - name: Tokens description: Manage organization API keys. - name: Traces description: Find your agent invocations and read what they did. security: - bearerAuth: [] - apiKey: [] paths: /secrets: get: operationId: listSecrets summary: List secrets tags: - Secrets security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListSecretsResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" post: operationId: createSecret summary: Create a secret tags: - Secrets security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateSecretRequest" responses: "200": description: Created content: application/json: schema: $ref: "#/components/schemas/Secret" "400": description: Bad request (invalid name or value) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "409": description: A secret with this name already exists content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /secrets/{name}: get: operationId: getSecret summary: Get a secret tags: - Secrets security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: name in: path required: true description: Name of the secret to return. schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Secret" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" put: operationId: updateSecret summary: Update a secret tags: - Secrets security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: name in: path required: true description: Name of the secret to update. schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateSecretRequest" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/Secret" "400": description: Bad request (invalid value) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" delete: operationId: deleteSecret summary: Delete a secret tags: - Secrets security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: name in: path required: true description: Name of the secret to delete. schema: type: string responses: "204": description: Deleted "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /sessions: get: operationId: listSessions summary: List sessions description: > Returns sessions ordered by their most recent matching invocation. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: agent_name in: query required: false description: > Return only sessions that ran this agent (e.g. "support-triage"). schema: type: string maxLength: 255 - name: agent_revision in: query required: false description: > Return only sessions that ran this agent revision (e.g. "a1b2c3d4"). Requires `agent_name`. schema: type: string maxLength: 255 - name: status in: query required: false description: > Return only sessions with an invocation in this state. `DONE` matches a successful invocation. schema: $ref: "#/components/schemas/SessionState" - name: invocation_key in: query required: false description: > Return only the session containing this invocation. schema: type: string minLength: 1 maxLength: 255 - name: since in: query required: false description: > Return only sessions with an invocation that started at or after this time. Defaults to 31 days ago. schema: type: string format: date-time - name: until in: query required: false description: > Return only sessions with an invocation that started at or before this time. Defaults to now and must be after `since`. schema: type: string format: date-time - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/SessionLimit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListSessionsResponse" "400": description: Invalid cursor or filter content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /sessions/{id}: parameters: - $ref: "#/components/parameters/SessionID" get: operationId: getSession summary: Get a session with its messages description: > Returns session metadata and messages in chronological order. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/Limit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/SessionResponse" "400": description: Invalid cursor content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" post: operationId: runSession summary: Run or resume a session description: > Starts a new session or continues an existing one with another agent invocation. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/IdempotencyKey" - $ref: "#/components/parameters/WaitTimeoutSeconds" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RunSessionRequest" responses: "200": description: Session run or resumed headers: Idempotency-Key: description: > Invocation key used for this request. Use it to retrieve or safely retry the invocation. schema: type: string content: application/json: schema: $ref: "#/components/schemas/RunSessionResponse" "400": description: Invalid request content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "409": description: The session has been deleted or the idempotency key was reused with a different request body content: application/json: schema: $ref: "#/components/schemas/ErrConflict" "423": description: Another invocation is currently running for this session content: application/json: schema: $ref: "#/components/schemas/ErrLocked" "402": description: The organization has no credit balance remaining content: application/json: schema: $ref: "#/components/schemas/ErrInsufficientCredit" "410": description: > The invocation was canceled instead of producing a response (only possible while waiting for a response, or when replaying a canceled invocation). content: application/json: schema: $ref: "#/components/schemas/ErrInvocationCanceled" "502": description: > The invocation failed instead of producing a response (only possible while waiting for a response, or when replaying a failed invocation). The body carries the failure kind and detail. content: application/json: schema: $ref: "#/components/schemas/ErrInvocationFailed" "504": description: Timed out waiting for the assistant response content: application/json: schema: $ref: "#/components/schemas/ErrTimeout" delete: operationId: deleteSession summary: Delete a session description: > Removes the session's messages, invocations, and external resources, marks it deleted, and keeps its audit log readable. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "204": description: Deleted "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" "409": description: The session is still running an invocation; retry after it ends content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /sessions/{id}/cancel: parameters: - $ref: "#/components/parameters/SessionID" post: operationId: cancelSession summary: Cancel a session's running invocation description: > Requests asynchronous cancellation and returns once accepted. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "202": description: Cancellation requested content: application/json: schema: $ref: "#/components/schemas/CancelSessionResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" "409": description: No invocation is currently running for this session content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /sessions/{id}/audit: parameters: - $ref: "#/components/parameters/SessionID" get: operationId: getSessionAudit summary: List a session's audit log description: > Returns an immutable record of session events in chronological order. tags: - Sessions security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/Limit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListAuditEventsResponse" "400": description: Invalid cursor content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /traces: get: operationId: listTraces summary: Search traces description: > Returns invocations newest first, without their spans. Running invocations are included. tags: - Traces security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: agent_name in: query required: false description: > Return only invocations of this agent (e.g. "support-triage"). schema: type: string maxLength: 255 - name: agent_revision in: query required: false description: > Return only invocations of this agent revision (e.g. "a1b2c3d4"). Combines with `agent_name`. schema: type: string maxLength: 255 - name: status in: query required: false description: > Return only invocations with this status. schema: $ref: "#/components/schemas/TraceStatus" - name: session_id in: query required: false description: > Return only invocations in this session. An unknown session returns `404`. schema: type: string minLength: 2 maxLength: 100 pattern: "^[0-9a-zA-Z._:-]+$" - name: since in: query required: false description: > Return only invocations that started at or after this time. Defaults to 31 days ago. schema: type: string format: date-time - name: until in: query required: false description: > Return only invocations that started at or before this time. Defaults to now and must be after `since`. schema: type: string format: date-time - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/TraceLimit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListTracesResponse" "400": description: Invalid cursor or filter content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: No session with the requested `session_id` content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /traces/{invocation_key}: parameters: - $ref: "#/components/parameters/InvocationKey" get: operationId: getTrace summary: Get one invocation's trace description: > Returns an invocation and its spans in chronological order. Spans may appear shortly after they occur and expire before the invocation does. tags: - Traces security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: payloads in: query required: false description: > Whether to include span inputs and outputs. Disabling payloads raises the maximum `limit` to 500. Use the same value on every page. schema: type: boolean default: true - name: attempts in: query required: false description: > Attempts whose spans to return. `final` returns only the latest; `all` includes earlier spans marked `superseded`. schema: type: string enum: [final, all] default: final - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/TraceSpanLimit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/TraceResponse" "400": description: Invalid cursor content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" "503": description: > The invocation's spans could not be read. Retry the request; the invocation and its spans are unaffected. headers: Retry-After: description: > Seconds to wait before retrying, when a wait is known to help. schema: type: integer content: application/json: schema: $ref: "#/components/schemas/ErrUnavailable" /organization: get: operationId: getOrganization summary: Get the current organization tags: - Organization security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Organization" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" patch: operationId: updateOrganization summary: Rename the current organization description: Requires the admin role. tags: - Organization security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateOrganizationRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Organization" "400": description: Bad request (invalid name) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" /organization/members: get: operationId: listOrganizationMembers summary: List organization members tags: - Organization security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListOrganizationMembersResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" /organization/members/{user_id}: delete: operationId: removeOrganizationMember summary: Remove an organization member description: > Requires the admin role. The last admin cannot be removed. tags: - Organization security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/MemberUserID" responses: "204": description: Removed "400": description: Bad request (invalid user_id) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" "404": description: Not a member of the organization content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" "409": description: The member is the organization's last admin content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /organization/members/{user_id}/role: put: operationId: setOrganizationMemberRole summary: Set an organization member's role description: > Requires the admin role. The last admin cannot be demoted. tags: - Organization security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/MemberUserID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SetOrganizationMemberRoleRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/OrganizationMember" "400": description: Bad request (invalid user_id or role) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" "404": description: Not a member of the organization content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" "409": description: The member is the organization's last admin content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /organization/invites: get: operationId: listInvites summary: List pending invitations description: > Returns unexpired invitations. Requires the admin role. tags: - Invites security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListInvitesResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" post: operationId: createInvite summary: Invite a user by email description: > The invitation is accepted when the recipient signs in and expires after 14 days. Requires the admin role. tags: - Invites security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateInviteRequest" responses: "200": description: Created content: application/json: schema: $ref: "#/components/schemas/Invite" "400": description: Bad request (invalid email or role) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" "409": description: An invitation for this email already exists content: application/json: schema: $ref: "#/components/schemas/ErrConflict" /organization/invites/{id}: delete: operationId: revokeInvite summary: Revoke a pending invitation description: Requires the admin role. tags: - Invites security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: id in: path required: true description: The invitation identifier. schema: type: string responses: "204": description: Revoked "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /tokens: get: operationId: listTokens summary: List API tokens description: Returns token metadata without token values. tags: - Tokens security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListTokensResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" post: operationId: createToken summary: Create an API token description: > Returns the token value only in this response. Requires the admin role. tags: - Tokens security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTokenRequest" responses: "200": description: Created — token value is returned only at creation time content: application/json: schema: $ref: "#/components/schemas/CreateTokenResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" /tokens/{id}: get: operationId: getToken summary: Get API token metadata description: Does not return the token value. tags: - Tokens security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: id in: path required: true description: Lookup identifier from the token value. schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Token" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" delete: operationId: deleteToken summary: Revoke an API token description: Requires the admin role. tags: - Tokens security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: id in: path required: true description: Lookup identifier of the token to revoke. schema: type: string responses: "204": description: Revoked "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "403": description: Forbidden - the caller is not an admin content: application/json: schema: $ref: "#/components/schemas/ErrForbidden" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /agents: get: operationId: listAgents summary: List agents description: > Returns agents that have run, with each agent's latest revision. tags: - Agents security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListAgentsResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /agents/{name}: parameters: - name: name in: path required: true description: The agent's name. schema: type: string get: operationId: getAgent summary: Get an agent description: > Returns the current revision and all revisions newest first. tags: - Agents security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Agent" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /agents/{name}/revisions/{revision}: parameters: - name: name in: path required: true description: The agent's name. schema: type: string - name: revision in: path required: true description: The agent revision to fetch. schema: type: string get: operationId: getAgentRevision summary: Get an agent revision description: > Returns the revision's model, tools, instructions, and MCP servers. tags: - Agents security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/AgentRevision" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /memorygroups: get: operationId: listMemoryGroups summary: List memory groups description: > Returns memory groups ordered by key, with each group's active memory count. tags: - Memories security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/Limit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListMemoryGroupsResponse" "400": description: Invalid cursor content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /memorygroups/{group}: get: operationId: listMemories summary: List a group's memories description: > Returns active memories newest first. Replaced memories are omitted. tags: - Memories security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/MemoryGroup" - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/Limit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListMemoriesResponse" "400": description: Invalid group or cursor content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" delete: operationId: deleteMemoryGroup summary: Delete a group's memories description: > Removes every memory in the group. Agents can add new memories later. tags: - Memories security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/MemoryGroup" responses: "204": description: Deleted "400": description: Invalid group content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /memorygroups/{group}/memories/{id}: delete: operationId: deleteMemory summary: Delete one memory description: > Permanently removes the memory from the group. tags: - Memories security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/MemoryGroup" - $ref: "#/components/parameters/MemoryID" responses: "204": description: Deleted "400": description: Invalid group content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrNotFound" /models: get: operationId: listModels summary: List models description: Returns available models and their providers. tags: - Models security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListModelsResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /health: get: operationId: health summary: Check service health tags: - Health security: [] responses: "200": description: Service is healthy content: application/json: schema: $ref: "#/components/schemas/HealthResponse" "503": description: Service is unavailable (shutting down) content: application/json: schema: $ref: "#/components/schemas/HealthResponse" /whoami: get: operationId: whoami summary: Get the authenticated caller description: > Returns the signed-in user and their organizations, or the API key and its organization. tags: - Auth security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/WhoamiResponse" "401": description: Unauthorized - invalid or missing token content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /billing/checkout: post: operationId: createCheckout summary: Buy prepaid credits description: > Creates a purchase and returns its payment URL. Credits are added when payment completes. tags: - Billing security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateCheckoutRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/CreateCheckoutResponse" "400": description: Bad request (invalid amount or URL) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" "503": description: Credit purchases are not available on this deployment content: application/json: schema: $ref: "#/components/schemas/ErrUnavailable" /billing/balance: get: operationId: getCreditBalance summary: Read your credit balance description: > Returns your organization's current prepaid credit balance in USD. tags: - Billing security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/CreditBalanceResponse" "400": description: Bad request (no active organization) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /billing/ledger: get: operationId: listCreditLedger summary: List your credit history description: > Returns purchases, grants, usage charges, and adjustments newest first, with the signed USD amount of each balance change. tags: - Billing security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - $ref: "#/components/parameters/AfterCursor" - $ref: "#/components/parameters/Limit" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ListCreditLedgerResponse" "400": description: Bad request (invalid cursor or limit) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" /billing/spend: get: operationId: getSpend summary: Get your spend breakdown description: > Returns what your usage cost, split by UTC day and by what was used: each model at each provider, and compute time. Model usage made with your own provider credential is listed separately and not charged to your credits. Each line carries the quantities it was rated from. tags: - Billing security: - bearerAuth: [] - apiKey: [] parameters: - $ref: "#/components/parameters/OrganizationHeader" - name: since in: query required: false description: > Include usage from the UTC day containing this time onward. Defaults to 31 days before `until`. schema: type: string format: date-time - name: until in: query required: false description: > Include usage through the end of the UTC day containing this time. Defaults to now and must be after `since`. schema: type: string format: date-time responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/SpendResponse" "400": description: Bad request (invalid window) content: application/json: schema: $ref: "#/components/schemas/ErrBadRequest" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrUnauthorized" components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT apiKey: type: http scheme: bearer description: Org-scoped API key issued via POST /tokens parameters: OrganizationHeader: name: X-Albus-Organization in: header required: false description: > Organization the request acts in. Defaults to the first organization the caller joined. Ignored for API keys. schema: type: string MemberUserID: name: user_id in: path required: true description: The member's user identifier. schema: type: string SessionID: name: id in: path required: true description: > Client-provided session identifier. Reuse it to continue the session. schema: type: string minLength: 2 maxLength: 100 pattern: "^[0-9a-zA-Z._:-]+$" IdempotencyKey: name: Idempotency-Key in: header required: false description: > Names the invocation and makes identical requests safe to retry. Reuse with a different body returns `409`. When omitted, the response returns a generated key and the request is not retry-safe. schema: type: string minLength: 1 maxLength: 255 InvocationKey: name: invocation_key in: path required: true description: > Invocation key sent or returned in the `Idempotency-Key` header. schema: type: string minLength: 1 maxLength: 255 MemoryGroup: name: group in: path required: true description: > Memory group to read or delete, matching the agent's `memory.group`. schema: type: string minLength: 1 maxLength: 256 MemoryID: name: id in: path required: true description: Identifier of the memory to delete. schema: type: string minLength: 1 maxLength: 64 AfterCursor: name: after in: query required: false description: > Continue after this cursor. For list responses, pass the preceding page's `next_cursor`; for session messages, pass the preceding page's last message `cursor`. schema: type: string Limit: name: limit in: query required: false description: Maximum number of items to return. schema: type: integer minimum: 1 maximum: 1000 default: 100 TraceLimit: name: limit in: query required: false description: Maximum number of traces to return. schema: type: integer minimum: 1 maximum: 100 default: 10 SessionLimit: name: limit in: query required: false description: Maximum number of sessions to return. schema: type: integer minimum: 1 maximum: 100 default: 25 TraceSpanLimit: name: limit in: query required: false description: > Maximum spans to return. Defaults to 25 with payloads and 500 without; these are also the respective maximums. schema: type: integer minimum: 1 maximum: 500 WaitTimeoutSeconds: name: wait_timeout_seconds in: query required: false description: > Wait up to this many seconds for the assistant response. Omit to wait 30 minutes; use 0 to return once accepted. A timeout does not stop the invocation. schema: type: integer format: int64 minimum: 0 maximum: 1800 default: 1800 schemas: HealthResponse: type: object required: - status properties: status: type: string example: "ok" WhoamiResponse: type: object description: > The caller a credential authenticates. Exactly one of user or api_key is present. properties: user: allOf: - $ref: "#/components/schemas/AuthenticatedUser" description: The signed-in user, when calling with a user session. api_key: allOf: - $ref: "#/components/schemas/AuthenticatedApiKey" description: The API key, when calling with an API key. AuthenticatedUser: type: object required: - user_id - email - active_organization - organizations properties: user_id: type: string description: Unique user identifier example: "user_123" email: type: string format: email description: User's email address example: "user@example.com" name: type: string description: User's display name example: "John Doe" roles: type: array items: type: string description: Roles in the active organization. example: ["admin"] active_organization: allOf: - $ref: "#/components/schemas/OrganizationMembership" description: > The organization the request acts on: the one named by the X-Albus-Organization header, or the one the user joined first. organizations: type: array items: $ref: "#/components/schemas/OrganizationMembership" description: Every organization the user belongs to, with their roles. issued_at: type: integer format: int64 description: Token issue timestamp (Unix epoch) expires_at: type: integer format: int64 description: Token expiration timestamp (Unix epoch) AuthenticatedApiKey: type: object required: - name - organization_id properties: name: type: string description: Display name of the API key (e.g. "ci-deploy"). organization_id: type: string description: The organization this key acts in. example: "42" OrganizationMembership: type: object required: - id - name - roles properties: id: type: string description: Organization identifier example: "42" name: type: string description: Organization display name example: "Acme Corp" roles: type: array items: type: string description: Roles the user holds in this organization example: ["admin"] CreateInviteRequest: type: object required: - email properties: email: type: string format: email description: Email address of the person to invite. role: type: string enum: - admin - member default: member description: Role to grant the invitee. Invite: type: object required: - id - email - role - expires_at - created_at properties: id: type: string description: Invitation identifier email: type: string description: Invited email address role: type: string description: Role the invitee will be granted expires_at: type: string format: date-time description: When the invitation stops being redeemable created_at: type: string format: date-time description: When the invitation was created ListInvitesResponse: type: object required: - invites properties: invites: type: array items: $ref: "#/components/schemas/Invite" Organization: type: object required: - id - name - created_at - issuer properties: id: type: string description: Organization identifier example: "42" name: type: string description: Organization display name example: "Acme Corp" created_at: type: string format: date-time description: When the organization was created. issuer: type: string format: uri description: OpenID issuer of the identity tokens Albus presents to the organization's MCP servers; verifiers use it as the expected `iss` claim and to discover the signing keys. example: "https://oidc.albus.sh/organizations/42" UpdateOrganizationRequest: type: object required: - name properties: name: type: string minLength: 1 maxLength: 100 description: New organization display name. example: "Acme Corp" Role: type: string enum: [admin, member] description: A member's role in an organization. OrganizationMember: type: object required: - user_id - email - name - role - joined_at properties: user_id: type: string description: User identifier example: "42" email: type: string description: Email address name: type: string description: Display name role: $ref: "#/components/schemas/Role" joined_at: type: string format: date-time description: When the user joined the organization. ListOrganizationMembersResponse: type: object required: - members properties: members: type: array items: $ref: "#/components/schemas/OrganizationMember" SetOrganizationMemberRoleRequest: type: object required: - role properties: role: $ref: "#/components/schemas/Role" ErrForbidden: type: object required: - message - code properties: message: type: string description: Human-readable error message example: "this action requires the admin role" code: type: string description: Machine-readable reason (e.g. "forbidden_not_admin"). example: "forbidden_not_admin" ErrUnauthorized: type: object required: - message properties: message: type: string description: Human-readable error message example: "Invalid or expired token" ErrNotFound: type: object required: - message properties: message: type: string description: Human-readable error message example: "Resource not found" ErrBadRequest: type: object required: - message properties: message: type: string description: Human-readable error message example: "Invalid request parameters" ErrConflict: type: object required: - message properties: message: type: string description: Human-readable error message example: "Idempotency key reused with a different request body" code: type: string description: Machine-readable reason (e.g. "last_admin"). example: "last_admin" ErrLocked: type: object required: - message properties: message: type: string description: Human-readable error message example: "Another invocation is currently running for this session" ErrInsufficientCredit: type: object required: - message properties: message: type: string description: Human-readable error message example: "organization has no credit balance remaining" CreateCheckoutRequest: type: object required: - amount_usd - success_url - cancel_url properties: amount_usd: type: integer format: int64 minimum: 5 maximum: 10000 description: Whole US dollars of credit to buy (e.g. 20). success_url: type: string description: > Where the buyer's browser goes after paying. Must be https (or http on localhost). cancel_url: type: string description: > Where the buyer's browser goes if they back out. Must be https (or http on localhost). CreateCheckoutResponse: type: object required: - url properties: url: type: string description: The payment page to send the buyer's browser to. CreditBalanceResponse: type: object required: - balance_usd properties: balance_usd: type: string description: > Your current credit balance as a decimal USD string (e.g. "14.99"). Negative when overdrawn. CreditLedgerEntry: type: object required: - kind - amount_usd - reference - created_at properties: kind: type: string enum: [purchase, grant, usage_burn, adjustment] description: > What moved the balance: a paid purchase, an operator grant, a usage charge, or a manual adjustment. amount_usd: type: string description: > The signed decimal USD amount the entry moved the balance by: positive for money in, negative for usage charged. reference: type: string description: > Identifies what the entry paid for or charged (e.g. the payment for a purchase, the metering window for a usage charge). created_at: type: string format: date-time description: When the entry was recorded. ListCreditLedgerResponse: type: object required: - entries properties: entries: type: array items: $ref: "#/components/schemas/CreditLedgerEntry" next_cursor: type: string description: > Cursor for the next page. Pass it as `after` to fetch the following entries. Omitted when there are no more entries. SpendLine: type: object required: - day - kind - usd properties: day: type: string format: date-time description: The UTC midnight starting the day this line covers. kind: type: string enum: [model, model_byok, hardware] description: > What was used: a model billed to your credits, a model called with your own provider credential, or the compute an invocation ran on. provider_name: type: string description: > The provider that served the model. Present on model and model_byok lines. model_name: type: string description: > The model that was called. Present on model and model_byok lines. sku: type: string description: > The compute item charged (e.g. "invocation_second"). Present on hardware lines. usd: type: string description: > What this line cost, as a decimal USD string. Zero when the usage was free. On a model_byok line this is the usage valued at our model prices for reference; you paid the provider directly and no credits were charged. input_tokens: type: integer format: int64 description: Prompt tokens sent, including cached ones. cached_input_tokens: type: integer format: int64 description: Prompt tokens served from the provider's cache. output_tokens: type: integer format: int64 description: Tokens the model generated. thoughts_tokens: type: integer format: int64 description: Tokens the model spent reasoning. wall_ms: type: integer format: int64 description: Milliseconds of compute time charged. SpendResponse: type: object required: - since - until - total_usd - lines properties: since: type: string format: date-time description: > The UTC midnight the lines start from, after widening `since` to a whole day. until: type: string format: date-time description: > The UTC midnight the lines stop before, after widening `until` to a whole day. total_usd: type: string description: > The sum of every line charged to your credits, as a decimal USD string. Excludes model_byok lines. lines: type: array items: $ref: "#/components/schemas/SpendLine" description: Ordered by day, then kind, provider, model, and sku. CancelSessionResponse: type: object required: - invocation_key properties: invocation_key: type: string description: The key of the invocation being canceled. ErrInvocationCanceled: type: object required: - message properties: message: type: string description: Human-readable explanation example: "the invocation was canceled" ErrInvocationFailed: type: object required: - message - kind properties: message: type: string description: Human-readable failure detail example: "invocation failed (crash): signal 9" kind: type: string description: > Failure classification: "crash" (unexpected exit or signal), "no_progress" (the harness stalled and was force-killed), or "interrupted" (the invocation could not continue), or "internal" (the invocation could not start). example: "crash" ErrTimeout: type: object required: - message properties: message: type: string description: Human-readable error message example: "Timed out waiting for the assistant response" ErrUnavailable: type: object required: - message properties: message: type: string description: Human-readable error message example: "Trace spans are temporarily unavailable" # Resource schemas Secret: type: object required: - name - masked_value properties: name: type: string masked_value: type: string description: The secret value with all but the last 3 characters masked. # Sessions API (top-level /sessions) Provider: type: object additionalProperties: false required: - name - credential properties: name: type: string description: Provider name (e.g. "openai", "google_ai_studio"). url: type: string description: Optional base URL override for the provider endpoint. credential: type: string description: > Secret reference the provider authenticates with (e.g. "albus.sh/secrets/my-key"), not a raw secret value. Model: type: object additionalProperties: false required: - name properties: name: type: string description: Model identifier (e.g. "gemini-3.6-flash", "claude-opus-4"). provider: $ref: "#/components/schemas/Provider" RunSessionRequest: type: object additionalProperties: false required: - user_prompt - agent_name - agent properties: user_prompt: type: string description: The user prompt driving this invocation. agent_name: type: string description: > Human-readable name identifying the agent (e.g. "support-triage"). Invocations sharing a name are grouped as one agent; each distinct configuration under it becomes a revision. agent: $ref: "#/components/schemas/AgentConfig" AgentConfig: type: object additionalProperties: false required: - model description: > The agent configuration for an invocation: the model, tools, instructions, and MCP servers that define its behavior. Invocations with the same configuration share a revision. properties: model: $ref: "#/components/schemas/Model" tools: $ref: "#/components/schemas/Tools" memory: $ref: "#/components/schemas/MemoryConfig" system_prompt: type: string description: System instructions for the model. Uses a default if omitted. max_steps: type: integer minimum: 1 description: > Max model steps before the invocation stops. Uses a default if omitted. mcp_servers: type: array items: $ref: "#/components/schemas/MCPServer" description: MCP servers whose tools are offered to the model. output_format: type: object additionalProperties: true description: > JSON Schema the answer must conform to; the answer is returned as a JSON document. Every object in the schema must set "additionalProperties" to false and list every property in "required". Choose a model that supports structured output. AgentMeta: type: object description: A row in the agent list — an agent's identity and activity. required: - name - revision_count - created_at - updated_at properties: name: type: string description: The agent's name. revision_count: type: integer format: int64 description: Number of distinct revisions of this agent. created_at: type: string format: date-time description: When the agent first ran. updated_at: type: string format: date-time description: When the agent last ran. ListAgentsResponse: type: object required: - agents properties: agents: type: array items: $ref: "#/components/schemas/AgentMeta" # Models API (top-level /models) ModelMeta: type: object description: A model Albus can run, and the provider serving it. required: - name - provider properties: name: type: string description: > Model identifier to send as the agent's model name (e.g. "gemini-3.6-flash"). provider: type: string description: > Provider serving this model (e.g. "google_ai_studio", or "open_weight" for open-weight models). pricing: $ref: "#/components/schemas/ModelPricing" ModelPricing: type: object description: > What the model currently costs, as decimal USD strings per one million tokens (e.g. "1.25"). Absent when the model is not yet priced. required: - input_usd_per_mtok - cached_input_usd_per_mtok - output_usd_per_mtok - thoughts_usd_per_mtok properties: input_usd_per_mtok: type: string description: Price per million input tokens. cached_input_usd_per_mtok: type: string description: Price per million cached input tokens. output_usd_per_mtok: type: string description: Price per million output tokens. thoughts_usd_per_mtok: type: string description: Price per million reasoning (thinking) tokens. ListModelsResponse: type: object required: - models properties: models: type: array items: $ref: "#/components/schemas/ModelMeta" AgentRevisionMeta: type: object description: A reference to one agent revision, without its configuration. required: - revision - created_at properties: revision: type: string description: Identifier of this agent revision. created_at: type: string format: date-time description: When this revision first ran. AgentRevision: type: object description: One revision of an agent, with its full configuration. required: - revision - created_at - config properties: revision: type: string description: Identifier of this agent revision. created_at: type: string format: date-time description: When this revision first ran. config: $ref: "#/components/schemas/AgentConfig" Agent: type: object description: > An agent identified by name, with its current revision's full configuration and the list of all its revisions newest first. required: - name - current - revisions properties: name: type: string description: The agent's name. current: $ref: "#/components/schemas/AgentRevision" revisions: type: array items: $ref: "#/components/schemas/AgentRevisionMeta" description: All revisions of the agent, newest first. MCPServer: type: object additionalProperties: false required: - name - url properties: name: type: string maxLength: 64 description: > Unique alias for the server. It prefixes the server's tool names (e.g. "github" exposes its search tool as "github__search"). url: type: string description: The server's Streamable HTTP endpoint. headers: type: object additionalProperties: type: string description: > HTTP headers sent to the server, with secret values as secret references (e.g. "albus.sh/secrets/github-mcp"); this is also where to send an API key or other non-Bearer credential. A literal value is sent as is, is returned as "", and does not change the agent's revision. allowed_tools: type: array items: type: string description: > The server tools the model may call. Omit to allow all of them. auth: allOf: - $ref: "#/components/schemas/MCPServerAuth" description: > How Albus authenticates to the server. Omit for the default, AlbusIdentityJWTAuth, which needs no credential from you; see that schema for what the server must verify. Setting "headers.Authorization" instead sends that header verbatim. MCPServerAuth: description: > The credential Albus presents to an MCP server, chosen by type. oneOf: - $ref: "#/components/schemas/AlbusIdentityJWTAuth" - $ref: "#/components/schemas/OAuth2ClientCredentialsAuth" - $ref: "#/components/schemas/BearerTokenAuth" discriminator: propertyName: type mapping: albus_identity_jwt: "#/components/schemas/AlbusIdentityJWTAuth" oauth2_client_credentials: "#/components/schemas/OAuth2ClientCredentialsAuth" bearer: "#/components/schemas/BearerTokenAuth" AlbusIdentityJWTAuth: type: object additionalProperties: false description: > A short-lived identity token issued by Albus for the calling organization and invocation, sent as "Authorization: Bearer". Your server must trust the organization's issuer (the "issuer" of the Organization resource) and require the server "url" as the audience; the issuer publishes its signing keys at "/.well-known/jwks.json". externalDocs: url: https://docs.albus.sh/guides/mcp-server-auth required: - type properties: type: type: string enum: - albus_identity_jwt OAuth2ClientCredentialsAuth: type: object additionalProperties: false description: > An access token obtained from your identity provider with the OAuth 2.0 client credentials grant. required: - type - token_url - client_id - client_secret properties: type: type: string enum: - oauth2_client_credentials token_url: type: string description: The identity provider's HTTPS token endpoint. client_id: type: string description: > The client identifier, as a secret reference or a literal. client_secret: type: string description: > The client secret, as a secret reference (e.g. "albus.sh/secrets/idp-client-secret"), never a raw value. audience: type: string description: The audience requested from the identity provider. scopes: type: array items: type: string description: The scopes requested from the identity provider. BearerTokenAuth: type: object additionalProperties: false description: A static bearer token sent with every request. required: - type - token properties: type: type: string enum: - bearer token: type: string description: > The token, as a secret reference (e.g. "albus.sh/secrets/mcp-token"), never a raw value. Tools: type: object additionalProperties: false description: > The built-in tools the model may call. Include a tool's block to offer it (e.g. {"web_search": {}}); omit it to withhold it. properties: web_search: $ref: "#/components/schemas/WebSearchTool" computer: $ref: "#/components/schemas/ComputerTool" WebSearchTool: type: object additionalProperties: false description: Offers the model web search. ComputerTool: type: object additionalProperties: false description: > Offers the model a persistent Linux sandbox to run commands in. MemoryConfig: type: object additionalProperties: false required: - group - generation description: > Configures durable memory shared by invocations in the same group. properties: group: type: string minLength: 1 maxLength: 256 pattern: '^[\p{L}\p{M}\p{N}\p{P}\p{S} ]+$' description: Key identifying invocations that share memory. generation: type: array minItems: 1 uniqueItems: true items: type: string enum: [agent, end_of_invocation] description: Points when this agent may generate memories. Session: type: object required: - id - state - invocation_count - created_at - updated_at properties: id: type: string minLength: 2 maxLength: 100 pattern: "^[0-9a-zA-Z._:-]+$" description: Client-provided session identifier. state: $ref: "#/components/schemas/SessionState" current_invocation_key: type: string description: > The key of the invocation currently running, if any. Omitted when the session is idle. invocation_count: type: integer format: int64 description: Number of invocations in this session. agent_name: type: string description: Name of the agent that last ran this session. agent_revision: type: string description: > Revision of the agent that last ran this session. Invocations with the same configuration share this value. created_at: type: string format: date-time updated_at: type: string format: date-time deleted_at: type: string format: date-time description: > When the session was deleted. A deleted session keeps its audit log but accepts no new invocations. Omitted while the session is live. SessionState: type: string enum: [RUNNING, DONE, FAILED, CANCELED] description: > Lifecycle state of the session: `RUNNING` while an invocation is in flight, otherwise how its latest invocation ended. SessionMessage: type: object required: - cursor - invocation_key - role - content - created_at properties: cursor: type: integer format: int64 description: > Position of this message in the session's history, ascending — not an index into the list it arrives in. invocation_key: type: string description: The key of the invocation that produced this message. role: type: string enum: [user, assistant] content: type: string created_at: type: string format: date-time SessionResponse: type: object required: - session - messages properties: session: $ref: "#/components/schemas/Session" messages: type: array items: $ref: "#/components/schemas/SessionMessage" RunSessionResponse: type: object required: - session properties: session: $ref: "#/components/schemas/Session" message: allOf: - $ref: "#/components/schemas/SessionMessage" description: > The assistant message this invocation produced. Absent when the invocation has not answered yet — a call with `wait_timeout_seconds=0`, or a wait that returned before the response existed. Use `GET /sessions/{id}` to read it later. AuditEvent: type: object required: - id - session_id - invocation_key - type - payload - event_time properties: id: type: string description: Stable identifier of this audit event within the session. session_id: type: string description: The session this event belongs to. invocation_key: type: string description: > Key of the invocation during which this event occurred. agent_revision: type: string description: The agent revision the invocation ran (e.g. "a1b2c3d4"). type: type: string enum: - agent_invocation - agent_step - model_call - tool_call - mcp_auth_rejected - harness_exit - invocation_failed - invocation_succeeded - llm_call - tool_result - run_failed - run_succeeded description: > The kind of event (e.g. "agent_invocation" for the request that started the invocation, "agent_step" for one turn, how it ended, and how long it took, "model_call" for a model call and the tool calls it requested, "tool_call" for an executed tool call and its output). "mcp_auth_rejected" records that the named MCP server rejected the credential the agent presented. Events recorded earlier use "llm_call", "tool_result", "run_failed" and "run_succeeded" for four of those kinds. payload: type: object additionalProperties: true description: > The event's details, whose shape depends on `type` (e.g. the model, its response, usage, and requested tool calls for "model_call"; the call's arguments, response, status, timing, and MCP server URL for "tool_call"). A large value may be stored truncated, marked by a flag such as `requestTruncated`; a truncated `request`, `response` or `content` also carries the byte count and SHA-256 digest of the complete value, in fields such as `requestBytes` and `requestSha256`. A "model_call"'s `request` is the input the model was given, so an invocation's final call using `output_format` includes turns Albus adds to obtain the JSON answer. event_time: type: string format: date-time description: When the event occurred. ListAuditEventsResponse: type: object required: - events properties: events: type: array items: $ref: "#/components/schemas/AuditEvent" next_cursor: type: string description: > Cursor for the next page. Pass it as `after` to fetch the following events. Omitted when there are no more events. Memory: type: object required: - id - content - status - created_at properties: id: type: string description: > Identifier of this memory; pass it to `DELETE /memorygroups/{group}/memories/{id}`. content: type: string description: The fact remembered, as the agent stated it. status: type: string enum: [active] description: Always `active`; only memories agents read are listed. created_at: type: string format: date-time description: When the memory was remembered. source_session: type: string description: > Customer-provided session identifier that produced the memory. source_invocation: type: string description: Invocation identifier that produced the memory. ListMemoriesResponse: type: object required: - memories properties: memories: type: array items: $ref: "#/components/schemas/Memory" next_cursor: type: string description: > Cursor for the next page. Pass it as `after` to fetch the following memories. Omitted when there are no more memories. MemoryGroup: type: object required: - key - active_memories - created_at properties: key: type: string description: > The group's name — the `memory.group` value agents sharing its memories run with. Read its memories at `GET /memorygroups/{group}`. active_memories: type: integer format: int64 description: Number of memories agents in the group currently read. created_at: type: string format: date-time description: When an agent first ran with this group. ListMemoryGroupsResponse: type: object required: - memory_groups properties: memory_groups: type: array items: $ref: "#/components/schemas/MemoryGroup" next_cursor: type: string description: > Cursor for the next page. Pass it as `after` to fetch the following groups. Omitted when there are no more groups. # Traces API (top-level /traces) TraceStatus: type: string enum: [RUNNING, SUCCEEDED, FAILED, CANCELED] description: > How an invocation or one of its attempts ended, or `RUNNING` while it is still in flight. `CANCELED` means it was stopped on request before it answered. TokenUsage: type: object description: Tokens consumed. Absent when none were recorded. properties: input_tokens: type: integer format: int64 output_tokens: type: integer format: int64 total_tokens: type: integer format: int64 thinking_tokens: type: integer format: int64 description: > Tokens the model spent reasoning before it answered, as reported by the provider. Absent when the provider reports none. TraceTimestamp: type: string format: date-time x-ogen-time-format: "2006-01-02T15:04:05.000Z07:00" description: An RFC 3339 timestamp with millisecond precision. TraceAttempt: type: object description: > One attempt of an invocation. An invocation is attempted again when an attempt cannot be finished, and every attempt starts the agent's work over: an attempt before the last one spent its own tokens and may have made tool calls whose effects stand, even though nothing it produced reached the invocation's output. required: - attempt - status - started_at properties: attempt: type: integer format: int32 description: > Which attempt this is, counting from 1. The last one is the attempt that produced the invocation's outcome, or the one still in flight, and the one whose spans come back unless `attempts=all` is requested. status: $ref: "#/components/schemas/TraceStatus" started_at: $ref: "#/components/schemas/TraceTimestamp" description: When the attempt began. ended_at: $ref: "#/components/schemas/TraceTimestamp" description: When the attempt ended. Absent while it runs. usage: $ref: "#/components/schemas/TokenUsage" TraceSummary: type: object description: One agent invocation — what it ran, how it ended, and when. required: - invocation_key - session_id - status - spans_expired - started_at properties: invocation_key: type: string description: > The invocation's key — the value sent as its Idempotency-Key, or the one the server returned in that header when it was omitted. session_id: type: string description: The session this invocation belongs to. agent_name: type: string description: > Name of the agent the invocation ran (e.g. "support-triage"). Absent for an invocation made before agent names were recorded. agent_revision: type: string description: > The agent revision the invocation ran (e.g. "a1b2c3d4"). Absent for an invocation made before revisions were recorded. status: $ref: "#/components/schemas/TraceStatus" spans_expired: type: boolean description: > Whether the invocation's spans have aged out. Spans are kept for the retention window (currently 90 days) from the invocation's start; the invocation itself is kept, so `status` and the fields beside it stay readable past it. started_at: $ref: "#/components/schemas/TraceTimestamp" description: When the invocation was accepted. ended_at: $ref: "#/components/schemas/TraceTimestamp" description: > When the invocation's outcome was recorded. Absent while it runs. TraceSpan: type: object description: > One span of an invocation — a model call, a tool call it requested, or a level of the invocation above them. required: - id - type - status - started_at - ended_at properties: id: type: string description: > Where the span sits in its session, as a dotted path you can read: `inv2` is the invocation itself — the second invocation of its session — `inv2.attempt1.step3` one step of it, a model call and the tool calls it requested, `inv2.attempt1.step3.model` that step's model call, and `inv2.attempt1.step3.tool1` a tool call it requested, numbered in the order it requested them. Every count starts at 1, no segment is ever `0`, and `.model` is a slot rather than a count, so a step has exactly one. `inv2.attempt1` is not a span you can fetch: an attempt is not a span, so a step's parent is the invocation, and only a model or tool call's parent is its own id without its last segment. The attempt segment is what keeps an id from being reused: the same step of a second attempt is `inv2.attempt2.step3`, never a fresh `inv2.attempt1.step3` under an id you have already read. An id comes from the span itself, not from the page or the attempts you asked for, so the same span has the same id on every page, under `attempts=final` and under `attempts=all`, and across requests. Ids are unique within a session, so the spans of several of a session's invocations read as one tree with the session as its root. parent_id: type: string description: > Id of the span this one belongs to: for a model call or a tool call, this span's id without its last segment; for a step, the invocation itself — an attempt is not a span. Absent only for the invocation. It is present even when the span it names is not in this response: the invocation is published once it has ended and a step once that step has ended, so a still-running invocation has spans whose parent is not there yet, which is not an error. Treat a parent you cannot find as one you do not have. attempt: type: integer minimum: 1 description: > Which attempt of the invocation this span belongs to, counting from 1 — the same number as the second segment of its `id`, so a retry is visible without reading the id. Absent on the invocation itself, which belongs to no single attempt. superseded: type: boolean description: > Whether this span belongs to an attempt that was tried again, so nothing it produced reached the invocation's output. Only `attempts=all` returns such spans, and what they did still stands: their tokens were spent and their tool calls had their effects. Absent on a span of the latest attempt. type: type: string enum: - invocation - step - model_call - tool_call description: > The kind of span (e.g. "invocation" for the invocation itself, "step" for one step, "model_call" for a model call, "tool_call" for a tool call it requested). name: type: string description: > The model or tool the span called (e.g. "WEB_SEARCH"). Absent for a span that called neither. status: type: string enum: [SUCCEEDED, FAILED] description: > Whether the span succeeded. Only finished spans are returned. error: type: string description: > Why the span failed. Absent when it succeeded. A long message is shortened, and then carries the same `[omitted: N of M bytes; sha256=…]` marker a payload does. started_at: $ref: "#/components/schemas/TraceTimestamp" description: When the span began. ended_at: $ref: "#/components/schemas/TraceTimestamp" description: When the span finished. usage: $ref: "#/components/schemas/TokenUsage" input: type: string description: > What the span was given. A shortened value carries its head and tail separated by a `[omitted: N of M bytes; sha256=…]` marker; a model call's payloads are left out entirely when the span records too much to keep. A tool call's input is the one that comes with `input_bytes` and `input_sha256`. input_bytes: type: integer format: int64 description: > Size of the complete input, when known. input_sha256: type: string description: > SHA-256 of the complete input, when known. input_truncated: type: boolean description: > Whether `input` is shortened or left out, when known. A left-out payload carries neither `input_bytes` nor `input_sha256`; the invocation's own shortened input carries no `input_truncated` either. output: type: string description: > What the span returned. A shortened value carries its head and tail separated by a `[omitted: N of M bytes; sha256=…]` marker; a model call's payloads are left out entirely when the span records too much to keep. A tool call's output is the one that comes with `output_bytes` and `output_sha256`. output_bytes: type: integer format: int64 description: > Size of the complete output, when known. output_sha256: type: string description: > SHA-256 of the complete output, when known. output_truncated: type: boolean description: > Whether `output` is shortened or left out, when known. A left-out payload carries neither `output_bytes` nor `output_sha256`; the invocation's own shortened output carries no `output_truncated` either. TraceFailure: type: object description: Why an invocation failed, and what to show for it. required: - kind - message properties: kind: type: string description: > Failure classification: "crash" (unexpected exit or signal), "no_progress" (the harness stalled and was force-killed), "interrupted" (the invocation could not continue), or "internal" (the invocation could not start). example: "crash" message: type: string description: The sentence recorded for this failure. example: "The invocation failed. Try again." TraceResponse: allOf: - $ref: "#/components/schemas/TraceSummary" - type: object required: - spans - session_position properties: failure: allOf: - $ref: "#/components/schemas/TraceFailure" description: > Why the invocation ended without answering. Present only when `status` is `FAILED` or `CANCELED`, and readable past the retention window, since it comes from the invocation rather than its spans. Read it here rather than from `GET /traces`, which reports only that an invocation failed — listing a page of reasons costs a lookup per invocation on it. session_position: type: integer minimum: 1 description: > Which invocation of its session this is, counting from 1 in the order they were created — the same number as the `inv` segment of every span's id, so you do not have to read an id to know which invocation you are holding. Invocations are only ever appended, so a position never changes. spans: type: array items: $ref: "#/components/schemas/TraceSpan" description: > A page of the invocation's spans, oldest first, from its latest attempt unless `attempts=all` asked for the earlier attempts as well. It can hold fewer than `limit`, or none at all, while `next_cursor` is present. Empty once `spans_expired` is true. attempts: type: array items: $ref: "#/components/schemas/TraceAttempt" description: > Every attempt of the invocation, oldest first, whichever attempts `spans` came from — so one entry means it ran once, and more than one means the attempts before the last produced nothing that reached its output, while still spending tokens and making any tool calls they made. Read them with `attempts=all`. Absent once `spans_expired` is true. next_cursor: type: string description: > Cursor for the next page. Pass it as `after` to fetch the following spans. Present whenever there may be more spans, however few this page returned; omitted once there are none left, including once `spans_expired` is true. ListTracesResponse: type: object required: - traces properties: traces: type: array items: $ref: "#/components/schemas/TraceSummary" description: > This page of invocations, newest first. It can hold fewer than `limit`, or none at all, while `next_cursor` is present. next_cursor: type: string description: > Cursor for the next page. Pass it as `after`, with no filters or with every filter this listing used repeated exactly, to fetch the following traces. Present whenever there may be more traces, however few this page returned; omitted only once there are none left. ListSessionsResponse: type: object required: - sessions properties: sessions: type: array items: $ref: "#/components/schemas/Session" description: > This page of sessions: most recently used first, or by most recent matching invocation when filtered. It can hold fewer than `limit`, or none at all, while `next_cursor` is present. next_cursor: type: string description: > Cursor for the next page. Pass it as `after`, with no filters or with every filter this listing used repeated exactly, to fetch the following sessions. Present whenever there may be more sessions, however few this page returned; omitted only once there are none left. Token: type: object description: API token metadata. Never includes the token value. required: - id - name - created_at properties: id: type: string description: Globally unique lookup identifier (the first segment of the token string). name: type: string description: Human-readable display name for the token. created_at: type: string format: date-time last_used_at: type: string format: date-time description: Timestamp of the last time this token was used for authentication. # Request/response envelopes ListSecretsResponse: type: object required: - secrets properties: secrets: type: array items: $ref: "#/components/schemas/Secret" CreateSecretRequest: type: object required: - name - value properties: name: type: string value: type: string description: The secret value. UpdateSecretRequest: type: object required: - value properties: value: type: string description: The new secret value. ListTokensResponse: type: object required: - tokens properties: tokens: type: array items: $ref: "#/components/schemas/Token" CreateTokenRequest: type: object required: - name properties: name: type: string # View-once response for POST /tokens — includes the full token value. # All other token responses use Token (which omits the value). CreateTokenResponse: type: object required: - id - name - token - created_at properties: id: type: string description: Globally unique lookup identifier. name: type: string description: Human-readable display name. token: type: string description: | The full API token value (format: alb--). Returned only at creation time — it cannot be retrieved again. created_at: type: string format: date-time