API referenceTutorialsmarkdownbrain.ai

Quick start

Mint a key, then make one call with it over HTTP and the same call through the CLI.

1. Mint a key

Open Organization settings, then Keys, and make a key for yourself or for one of your organization's agents. Only the organization's owner can mint keys. The key is shown once, so copy it then.

A key acts as one member of one organization, exactly as that member would in the app. Keep it in an environment variable rather than in a script:

export MDBRAIN_API_KEY='mdb_key_…'

2. Call the API

GET /v1/me answers who the key acts as, and which brains it can reach:

curl https://api.markdownbrain.ai/v1/me \
  -H "Authorization: Bearer $MDBRAIN_API_KEY"

The answer is whoami's, as JSON.

3. The same call through the CLI

With mdbrain installed, the same operation by its name:

mdbrain call whoami

mdbrain reads MDBRAIN_API_KEY when it is set, and your mdbrain login otherwise.

Next

Every operation has its own page under Operations, with its route, its arguments and an example. list_files and read_file are good ones to try next.