SDKs & Claude Code

Official LVNG client libraries for TypeScript and Python, plus the Claude Code MCP server. All three are released and cover the entire v2 API surface — chat, agents, workflows, knowledge graphs, and 47 other resources.

Choose your language

Send your first chat request from cURL, Python, or Node. The picker below is shared across every endpoint card on the docs — pick once and the rest of the site follows.

cURL
curl -X POST https://api.lvng.ai/api/v2/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello, LVNG!",
    "platform": "api"
  }'

What you get

TypeScript & Python parity

  • -Both SDKs cover all 51 OpenAPI tags / 386 operations
  • -Hand-tuned overrides for chat, workflows, agents, knowledge, API keys
  • -Identical error hierarchy (LvngError → AuthenticationError, RateLimitError, NotFoundError, ValidationError)

Real-time streaming

  • -Server-Sent Events for chat.stream
  • -TS: for await (const ev of client.chat.streamEvents({ ... }))
  • -Python: for event in client.stream_chat(message="..."), or async via aiterate_sse

Resilient by default

  • -Exponential backoff on 429 / 503, honours Retry-After
  • -Per-request timeouts with AbortSignal (TS) / asyncio cancellation (Python)
  • -Idempotency-Key header support for safe retries on POST

Production polish

  • -TS: dual ESM/CJS, tree-shakable, .d.ts ships with the package
  • -Python: typed (PEP 561), pydantic v2 models, sync + async siblings
  • -Both SDKs published under the LVNG MIT license

Resource coverage

Both SDKs ship a class per OpenAPI tag, auto-discovered from the spec. The table below highlights the hand-tuned resources; the full list of 51 tags is generated and lives in resources/_generated (TS) and resources/_generated (Python).

ResourceTypeScriptPython
chatclient.chat.send / streamEventsclient.chat.send / stream_chat
workflowsclient.workflows.list / execute / parseclient.workflows.list / execute
agentsclient.agents.create / messageclient.agents.create / message
knowledgeclient.knowledge.search / ingestclient.knowledge.search / ingest
apiKeysclient.apiKeys.create / revokeclient.api_keys.create / revoke
46 other tagsclient.<resource>.<method> via _generatedclient.<resource>.<method> via _generated

Claude Code (MCP server)

The LVNG MCP server connects Claude Code to your workspace, giving Claude direct access to 21 tools across workflows, agents, and knowledge. No code required.

Setup

  1. 1Generate an API key from Settings → Developer.
  2. 2Install the MCP server.
Install
# Install from npm
npm install -g @lvng/mcp-server

# Or run directly without a global install
npx @lvng/mcp-server
  1. 3Add the LVNG MCP server to your Claude Code configuration.
Claude Code Settings
// Add to ~/.claude/settings.json
{
  "mcpServers": {
    "lvng": {
      "command": "lvng-mcp-server",
      "env": {
        "LVNG_API_KEY": "lvng_sk_live_..."
      }
    }
  }
}
  1. 4Start asking Claude to interact with your workspace.
Claude Code Examples
> list my workflows
> create an agent called "Data Analyst" with web search tools
> search knowledge for "Q4 revenue"
> execute workflow wf_123 with topic "market research"

Available tools (21)

CategoryTools
Workflows (9)list, get, create, update, delete, execute, get_run, list_runs, parse
Agents (8)list, get, create, update, delete, message, start, stop
Knowledge (4)search, ingest, list_entities, get_stats

REST API

Both SDKs sit on top of the same JSON REST API, so you can drop down to raw HTTP whenever you need to.

cURL
curl https://api.lvng.ai/api/v2/workflows \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Next steps