Start with the product you are building for.
Canopy Host and Cortex are separate products with separate API surfaces and SDK packages. Choose the right reference before copying an example.
Software delivery
Build and operate projects, environments, pipelines, artifacts, releases, and runtime workloads through the Host API.
- API: Host API reference
- TypeScript SDK:
@canopy/sdk - CLI:
canopy - MCP: Host tools are documented by capability in the product docs.
import { createCanopySDK } from "@canopy/sdk";
const host = createCanopySDK({
baseUrl: "https://api.canopy.pm",
apiKey: process.env.CANOPY_API_KEY,
});
const projects = await host.projects.list();Knowledge retrieval and cited answers
Create knowledge spaces, ingest material, retrieve relevant passages, and return answers with citations through the Cortex API.
- API: Cortex API reference
- TypeScript SDK:
@canopy/cortex-sdk - CLI: Cortex CLI, with command availability depending on the workflow.
import { createCortexSDK } from "@canopy/cortex-sdk";
const cortex = createCortexSDK({
apiKey: process.env.CORTEX_API_KEY,
});
const productInstanceId = Number(process.env.CORTEX_PRODUCT_INSTANCE_ID);
const conversation = await cortex.conversations.create({ productInstanceId });
const result = await cortex.responses.create(
conversation.id,
productInstanceId,
"Where is the process documented?"
);
console.log(result.citations);A key needs the required scopes and a valid knowledge-space context.
Packages use Canopy’s restricted registry.
The SDK packages are published to Canopy’s npm-compatible registry. Authenticate the scope before installing. Exact registry setup is maintained in the developer docs.
canopy registry login --scope @canopy
bun add @canopy/sdk
bun add @canopy/cortex-sdk@canopy/sdk targets Canopy Host. @canopy/cortex-sdk targets Cortex. Cortex has its own credential, API contract, and lifecycle rules.Reference material
Canopy documentation
Product guides, API contracts, CLI usage, and MCP references.
Open docs.canopy.pm ↗Host product
Learn how source, pipeline, release, and runtime records fit together.
Canopy Host overview ↗