Docs · reference
SDKs and Client Libraries
Teamday integration options: OpenAPI, REST, official TypeScript and Python SDK package sources, Server-Sent Events, MCP, and the official CLI.
SDKs and Client Libraries
Teamday's primary integration contract is the machine-readable OpenAPI spec:
https://app.teamday.ai/api/openapi.json
Use the spec with generated clients or with the official thin SDK package sources below. SDK examples and package metadata are also exposed as machine-readable JSON:
https://app.teamday.ai/api/sdk-examples
https://app.teamday.ai/api/sdk/manifest
Interactive reference:
https://app.teamday.ai/api/reference
Integration Options
| Option | Status | Best for |
|---|---|---|
| OpenAPI 3.1 | Production | Generating typed clients and tool schemas |
@teamday/api-sdk | Official package source | TypeScript integrations, agent tooling, and SDK contract tests |
teamday-api-sdk | Official package source | Python jobs, notebooks, and agent runners |
| OpenAPI generated clients | Official generation path | External clients and language-specific toolchains |
| REST API | Production | Server-side integrations and automation |
| Server-Sent Events | Production | Streaming chat and job output |
| MCP Streamable HTTP | Production | Tool-using agents and MCP clients |
| Teamday CLI | Production | Local operator agents, setup, smoke tests, and admin workflows |
Official SDK Package Source
Teamday keeps the maintained SDK surface in the monorepo and publishes its machine-readable package manifest through the API:
packages/teamday-api-sdk
https://app.teamday.ai/api/sdk/manifest
The package provides importable TypeScript and Python source, local package manifests, request/idempotency helpers, SSE parsing, webhook verification, and tests. The canonical contract remains https://app.teamday.ai/api/openapi.json.
Run it locally:
bun run --cwd packages/teamday-api-sdk build
bun run --cwd packages/teamday-api-sdk test
Generate A Client
Use any OpenAPI generator that supports OpenAPI 3.1:
curl -o teamday-openapi.json https://app.teamday.ai/api/openapi.json
npx openapi-typescript teamday-openapi.json -o teamday-api.d.ts
npx @openapitools/openapi-generator-cli generate \
-g typescript-fetch \
-i teamday-openapi.json \
-o ./teamday-typescript
openapi-generator-cli generate \
-g python \
-i teamday-openapi.json \
-o ./teamday-python
The generated clients target the same production contract as the app. There is no private docs surface required for an agent to generate and validate an integration.
Official SDK Contract
Teamday keeps official SDKs intentionally thin and OpenAPI-aligned:
| SDK | Status | Runtime |
|---|---|---|
| TypeScript fetch client | Official package source | Node.js, Bun, browser, edge workers |
| Python standard-library client | Official package source | Python 3.10+, agent runners, backend jobs, notebooks |
| OpenAPI Generator clients | Official generation path | Any generator supporting OpenAPI 3.1 |
The SDK contract is bearer auth, typed requests, idempotency helpers, SSE streaming, webhook verification, and request-id/rate-limit header access. The canonical source is always https://app.teamday.ai/api/openapi.json, with local source in packages/teamday-api-sdk, and the machine-readable package manifest exposed at https://app.teamday.ai/api/sdk/manifest.
Non-production Teamday deployments mirror the production contract: OpenAPI, auth, SSE, webhook signing, idempotency, error shapes, and rate-limit headers are identical apart from the base URL.
Official thin SDK source is available directly from the API:
https://app.teamday.ai/api/sdk/typescript
https://app.teamday.ai/api/sdk/python
Minimal TypeScript Client
const TEAMDAY_BASE_URL = "https://app.teamday.ai"
async function teamday(path: string, init: RequestInit = {}) {
const response = await fetch(`${TEAMDAY_BASE_URL}${path}`, {
...init,
headers: {
Authorization: `Bearer ${process.env.TEAMDAY_TOKEN}`,
"Content-Type": "application/json",
...init.headers,
},
})
if (!response.ok) {
const requestId = response.headers.get("x-request-id")
const body = await response.json().catch(() => ({}))
throw new Error(`${response.status} ${body.code ?? body.error ?? "request_failed"} request=${requestId}`)
}
return response.json()
}
const agents = await teamday("/api/agents")
Minimal Python Client
import os
import uuid
import httpx
client = httpx.Client(
base_url="https://app.teamday.ai",
headers={
"Authorization": f"Bearer {os.environ['TEAMDAY_TOKEN']}",
"Content-Type": "application/json",
},
)
response = client.post(
"/api/chats",
headers={"Idempotency-Key": str(uuid.uuid4())},
json={"agent_id": agent_id, "workspace_id": workspace_id},
)
response.raise_for_status()
chat = response.json()
Streaming Client
For long-running work, open the event stream for the chat or job:
const stream = await fetch(`${TEAMDAY_BASE_URL}/api/jobs/${jobId}/events`, {
headers: { Authorization: `Bearer ${process.env.TEAMDAY_TOKEN}` },
})
if (!stream.ok || !stream.body) throw new Error(`stream failed ${stream.status}`)
for await (const chunk of stream.body) {
process.stdout.write(Buffer.from(chunk).toString("utf8"))
}
Webhook Verification
Webhook receivers should verify Teamday-Signature, dedupe on Teamday-Event-Id, and treat Idempotency-Key as the delivery key.
import { createHmac, timingSafeEqual } from "node:crypto"
function verifyTeamdayWebhook(rawBody: string, signature: string, secret: string) {
const parts = Object.fromEntries(signature.split(",").map((part) => part.split("=")))
const expected = createHmac("sha256", secret)
.update(`${parts.t}.${rawBody}`)
.digest("hex")
return timingSafeEqual(Buffer.from(parts.v1, "hex"), Buffer.from(expected, "hex"))
}
Sandbox And Production Parity
Teamday deployments expose the same OpenAPI contract, auth scheme, SSE events, webhook signing, idempotency behavior, and rate-limit headers. Use the deployment base URL as the only environment variable:
export TEAMDAY_BASE_URL="https://app.teamday.ai"
export TEAMDAY_TOKEN="<teamday-service-token>"
curl -fsS "$TEAMDAY_BASE_URL/api/agent-readiness" \
-H "Authorization: Bearer $TEAMDAY_TOKEN"
CLI
Install and use the Teamday CLI for local agent setup and operational checks:
teamday whoami
teamday agents list
teamday chat <agent-id> "Summarize the current workspace."
teamday jobs events <job-id>
The CLI uses the same API primitives as the app: service-token auth, durable chats, jobs, missions, workspace files, and SSE streams.