CADPrk6a…krfpump
habitat

Habitat for developers

Build with
living agents.

A REST API, a TypeScript SDK and a two-line embed. Create agents, teach them, publish them and stream their answers into your product.

Try every endpoint in the playground
import { HabitatClient } from "./habitat"; // sdk/typescript/src/index.ts — one file, no dependencies

const habitat = new HabitatClient({ apiKey: process.env.HABITAT_API_KEY!, baseUrl: "https://habitat-agents.vercel.app" });

const agent = await habitat.agents.create({ name: "Atlas", category: "research" });
await habitat.knowledge.add(agent.id, { type: "url", url: "https://example.com/docs", maxPages: 10 });
await habitat.agents.publish(agent.id, "unlisted");

for await (const event of habitat.chat(agent.id, { message: "What's new in the docs?" })) {
  if (event.type === "text") process.stdout.write(event.delta);
}

What you can build

Agents where your people already are.

Support agents on your site

Teach an agent your docs and FAQ through the API, then drop the embed or the React component into your product.

Copilots inside your app

Stream answers into your own UI with the SDK's async iterator — tool activity, citations and usage included.

Community bots

Call the chat endpoint from your Discord or Telegram bot and keep the agent's personality and knowledge in Habitat.

Research pipelines

Add sources in bulk, wait for indexing, then ask grounded questions with JSON responses you can store.

REST API · v1

Eleven endpoints. One key.

JSON in, JSON out — plus Server-Sent Events for chat. Bearer-token auth with scoped keys, CORS for browser calls, consistent errors.

  • GET/v1/agentsList your agentsagents:read
  • POST/v1/agentsCreate a draft agentagents:write
  • GET/v1/agents/{id}Get an agent by id or handleagents:read
  • PATCH/v1/agents/{id}Update identity or configurationagents:write
  • POST/v1/agents/{id}/chatChat (SSE stream or JSON)chat
  • POST/v1/agents/{id}/knowledgeAdd text, FAQ, website or file knowledgeknowledge:write
  • GET/v1/agents/{id}/knowledgeList knowledge sources and indexing statusagents:read
  • GET/v1/agents/{id}/toolsEnabled tools and availabilityagents:read
  • GET/v1/agents/{id}/analyticsAggregate analytics (1–90 days)analytics:read
  • POST/v1/agents/{id}/publishPublish (public, unlisted or private)agents:write
  • POST/v1/agents/{id}/unpublishReturn to draftagents:write

Scoped keys

agents:read, agents:write, chat, knowledge:write, analytics:read. Secrets are shown once and stored as hashes.

Clear limits

1,000 requests per key per day and 60 per minute, with X-RateLimit headers and Retry-After on 429s.

Real streaming

Chat streams meta, retrieval, tool calls, text deltas, usage and done events — the same protocol Habitat's own UI uses.

Embed anywhere

Two lines of HTML. Or one component.

Any published agent with embedding on can live on your site as a floating bubble or an inline window. No API key needed — visitors chat within Habitat's visitor limits, and creators can restrict which sites may embed.

<!-- Floating chat bubble -->
<script src="https://habitat-agents.vercel.app/embed.js" data-agent="atlas" data-mode="floating" async></script>

<!-- Inline window -->
<div id="atlas-chat"></div>
<script src="https://habitat-agents.vercel.app/embed.js" data-agent="atlas" data-mode="inline" data-target="#atlas-chat" data-height="600px" async></script>

Live: @luna, a real public agent on this Habitat, embedded with <HabitatAgent />

Webhooks Not available yet

Event callbacks aren't available yet. Poll the API for now — knowledge sources report their indexing status.

npm packages Not available yet

The SDK and React component are single files in this repository today — copy them in. Published packages may come later.

Your first API call is a minute away.

Create a key, paste it into the playground and talk to an agent — no install required.