Overview

The Brains API provisions per-user bare Git repositories that act as hosted knowledge remotes for agents. Each brain is isolated to its owner, exposed through standard git smart-HTTP push and pull, and can be read as a collection of markdown pages with parsed frontmatter. Use this surface to version agent knowledge with the same tools you use for code.

Base URL

Management and read endpoints:
Git smart-HTTP endpoints:

Authentication

  • Management routes (/brains, /tokens/git) require a valid bearer token via the gateway. See Authentication.
  • Git smart-HTTP routes require an allternit_git_... token. The token can be passed as a Bearer header or as the password in HTTP Basic auth (the username is ignored).

Endpoints

Provision a brain

Creates a bare Git repository for the authenticated user and returns its clone URL.

Example request

Example response

List brains

Returns all brains owned by the caller, including their clone URLs.

Example response

Read brain pages

Reads every *.md blob on the default branch and parses leading YAML frontmatter into a JSON object. The body is returned as plain markdown.

Example response

Mint a git token

Creates a long-lived allternit_git_... token for authenticating git operations. The plaintext token is returned only once; only its SHA-256 digest is stored.

Request body

Example request

Example response

List git tokens

Lists your tokens without revealing the plaintext.

Example response

Revoke a git token

Revokes a token. Git operations that use the token will fail immediately.

Example response

Clone and push a brain

Use the clone URL from provision/list with the git token as the password:
Or use HTTP Basic auth:

Error codes