Call Archie From Your Own Code
Use the Python SDK or the TypeScript client to call Archie from your own code. Both speak to the same Archie your clients already talk to, over the same Connect API.
The per-skill surface is generated from the canonical skill registry, so it tracks the live catalogue. Prefer nothing to install? The REST API and the OpenAPI 3.1 spec reach every skill from any language.
Install the Client
Python needs 3.10 or newer and ships on PyPI as heyarchie, with the archie CLI in the same package. The TypeScript client needs Node 20 or newer and ships on npm as heyarchie too. It is an ES module, so use import, not require.
python3 -m venv .venv source .venv/bin/activate pip install heyarchie
npm install heyarchie
Current releases: heyarchie 2.1.0 on PyPI (the Python SDK and the archie CLI) and heyarchie 3.1.0 on npm (the TypeScript client).
Create a Client
Pass your key: api_key in Python, apiKey in TypeScript. Keys start with sk_. The TypeScript client also reads ARCHIE_API_KEY from the environment; the Python client does not, so pass the key yourself. Then name your region: environment="uk" in Python, environment: "uk" in TypeScript, or ARCHIE_ENVIRONMENT=uk for either. A full address works too: base_url in Python, baseURL in TypeScript, or ARCHIE_API_URL. There is no default address, so with none of these both clients stop with an error that lists the regions.
from heyarchie import Archie archie = Archie(api_key="sk_...", environment="uk") # or give the address: archie = Archie(api_key="sk_...", base_url="https://uk.heyarchie.com") # or set ARCHIE_ENVIRONMENT=uk (or ARCHIE_API_URL) and pass only the key
import { Archie } from "heyarchie";
const archie = new Archie({
apiKey: "sk_...", // or set ARCHIE_API_KEY and omit
environment: "uk", // or baseURL: "https://uk.heyarchie.com"; or set ARCHIE_ENVIRONMENT or ARCHIE_API_URL and omit
});Client Options
Your Connect key (sk_*). TypeScript falls back to the ARCHIE_API_KEY environment variable. Python requires it.
Your region's address, such as https://uk.heyarchie.com. There is no default: without baseURL or environment the client reads ARCHIE_API_URL, then ARCHIE_ENVIRONMENT, and throws if neither is set. Note the capital URL: an unknown key such as baseUrl is silently ignored.
Your region's name: uk, us, au or ca, used instead of baseURL. Passing both throws. Falls back to ARCHIE_ENVIRONMENT.
Per-request timeout in milliseconds. Defaults to 920000.
Overrides the global fetch, for tests or custom retry.
One Method per Skill
Every public skill is a typed method: on client.skills in Python, and on archie.skills.generated in TypeScript as camelCase of the slug. Each delegates to skills.invoke(), so the wire format is unchanged, and skills.invoke() still calls any skill by slug.
from heyarchie import Archie
client = Archie(api_key="sk_...", base_url="https://uk.heyarchie.com")
# List topics: typed kwargs, no JSON body to assemble
topics = client.skills.topic_list(limit=5)
# Create one
client.skills.topic_create(name="FY26 audit, Acme", type="client")
# Advisory skills are typed too
advice = client.skills.advise_tax(
topic="CGT discount on an active asset",
jurisdiction="AU",
)// One typed method per skill — camelCase of the slug
const topics = await archie.skills.generated.topicList({ limit: 5 });
await archie.skills.generated.topicCreate({
name: "FY26 audit — Acme",
type: "client",
});
const advice = await archie.skills.generated.adviseTax({
topic: "CGT discount on an active asset",
jurisdiction: "AU",
});Handle Errors by Type
Non-2xx responses raise typed errors decoded from the canonical error envelope, each with a request id. Both clients retry a 429 once on their own: Python waits for Retry-After (one second if it is missing, never more than 60), and TypeScript retries only when Retry-After is 60 seconds or less.
from heyarchie import (
ArchieAuthError, # 401, invalid or revoked key
ArchiePermissionError, # 403, key lacks permission
ArchieRateLimitError, # 429, includes retry_after (seconds, or None)
ArchieNotFoundError, # 404
ArchieAPIError, # 5xx
)
try:
reply = archie.skills.invoke("ask_archie", query="...")
except ArchieRateLimitError as e:
time.sleep(e.retry_after or 60)
except ArchieAPIError as e:
log.exception("archie call failed", extra={"request_id": e.request_id})import {
ArchieAuthError, // 401, invalid or revoked key
ArchiePermissionError, // 403, key lacks permission
ArchieNotFoundError, // 404
ArchieIdempotencyError, // 409, idempotency conflict
ArchieRateLimitError, // 429, check detail.retry_after_seconds
ArchieAPIError, // 5xx
ArchieError, // base class
} from "heyarchie";
try {
await archie.skills.invoke("ask_archie", { query: "..." });
} catch (err) {
if (err instanceof ArchieRateLimitError) {
const wait = err.detail.retry_after_seconds ?? 60;
// back off
} else if (err instanceof ArchieError) {
console.error(err.detail.code, err.detail.message, err.requestId);
} else {
throw err;
}
}What the Client Covers
WorkStreams are run through the workstream skills and the Python command line.
Use Archie Skills as Agent Tools
One line turns Archie skills into native tools in LangGraph, LangChain or the OpenAI Agents SDK. The adapter fetches the live registry at call time, and scope= filters to skills whose permission prefix matches, the same names as API key permissions, such as ask:execute.
from heyarchie.adapters.langgraph import as_langgraph_tools from langchain_anthropic import ChatAnthropic # Standalone function tools = as_langgraph_tools(api_key="sk_...", base_url="https://uk.heyarchie.com", scope="ask:execute") model = ChatAnthropic(model="claude-sonnet-5-5").bind_tools(tools) from heyarchie import Archie # Or via the client archie = Archie(api_key="sk_...", base_url="https://uk.heyarchie.com") tools = archie.skills.as_langgraph_tools(scope="ask:execute")
from heyarchie.adapters.openai_agents import as_openai_tools
from agents import Agent, Runner
tools = as_openai_tools(api_key="sk_...", base_url="https://uk.heyarchie.com", scope="ask:execute")
agent = Agent(
name="Archie Tax Advisor",
instructions="Expert accounting assistant.",
tools=tools,
)
result = Runner.run_sync(agent, "What is the BAS for Q1 2026?")
print(result.final_output)