Getting started
Create an API token, fetch a prompt with curl, then use the TypeScript SDK, the Python SDK or the CLI.
Public prompts can be read without an account. You need a token to read your own private or unlisted items, and to write anything.
Create a token
- Sign in and open Settings → Security.
- Under API tokens, create a token and pick its scopes:
read: read prompts, makes and your private content.write: create and update prompts, versions and labels (impliesread).evals:write: report eval runs from CI (impliesread).
- Copy the token. It starts with
inc_and is shown once; the server keeps only its hash.
Send it as a bearer token:
export INCANTORY_TOKEN=inc_...
curl -H "Authorization: Bearer $INCANTORY_TOKEN" https://incantory.ai/api/meIn CI, prefer the CLI's device login on your own machine and an INCANTORY_TOKEN secret in the pipeline.
Fetch a prompt with curl
A prompt with its latest version (metadata, labels, files, variables):
curl https://incantory.ai/api/v1/prompts/alice/code-reviewThe version a label points at, or a pinned version:
curl "https://incantory.ai/api/v1/prompts/alice/code-review?label=production"
curl https://incantory.ai/api/v1/prompts/alice/code-review/versions/3Just the entry file as plain text:
curl "https://incantory.ai/api/v1/prompts/alice/code-review/raw?label=production"Version responses are immutable and carry an ETag, so repeated requests with If-None-Match get 304 Not Modified. See the REST API reference for everything else.
TypeScript
npm install @incantory/sdkimport { Incantory } from '@incantory/sdk';
const inc = new Incantory(); // token from $INCANTORY_TOKEN, optional for public prompts
const prompt = await inc.prompts.get('alice/code-review@production');
console.log(prompt.ref); // alice/code-review@v7
console.log(prompt.text({ language: 'Go', code: 'x := 1' }));More in the TypeScript SDK guide.
Python
pip install incantoryUntil the package is on PyPI, install it from a checkout of the repository with pip install ./sdk/python.
from incantory import Incantory
with Incantory() as client: # token from INCANTORY_TOKEN
prompt = client.prompts.get("alice/code-review@production")
out = prompt.render({"language": "Go", "code": "x := 1"})
print(out.text)More in the Python SDK guide.
CLI
npx incantory login
npx incantory render alice/code-review@production --var language=Go --var [email protected]
npx incantory add alice/code-review@production --to claudelogin runs a device flow in your browser and stores the token in ~/.config/incantory/credentials.json. More in the CLI guide and Install into tools.
Next steps
- Learn the model: Concepts.
- Connect an AI client: MCP.
- React to changes: Webhooks.
- Gate releases on tests: Evals and the CI gate.