Python, TypeScript & Go SDKs

Build with LyDos SDK

Official SDKs for Python, TypeScript, and Go. Stream responses, run 100+ agents, and integrate with your stack in minutes.

100+Agents available
245Q-Engines
3Official SDKs
<50msAvg latency
99.9%Uptime SLA
Installation

Get started in seconds

Install the SDK for your language of choice. Requires an API key from your settings page.

install.sh
Bash
# Python SDK — Beta (not yet published to PyPI)
# Install from source during beta:
git clone https://github.com/lydianai/AILYDIAN-AGENT-ORCHESTRATOR.git
cd AILYDIAN-AGENT-ORCHESTRATOR && pip install -r requirements.txt
Core Concepts

How the SDK works

Understand authentication, clients, and rate limits before diving in.

Authentication

All requests require an API key with prefix lyd_sk_. Pass it directly or set LYDOS_API_KEY in your environment.

Base Client

One client instance per application. It handles connection pooling, retries, and transparent failover across LLM providers.

Rate Limiting

Starter: 60 RPM. Pro: 600 RPM. Enterprise: 6,000+ RPM. SDKs automatically retry with exponential backoff on 429 errors.

Error Handling

Every SDK call throws typed exceptions: LyDosAuthError, LyDosRateLimitError, LyDosNotFoundError, and a base LyDosError.

Code Examples

Real examples. Production-ready.

Browse examples by language. All snippets are copy-paste ready.

Quick Start

quickstart.py
Python
1from lydos import LyDos
2 
3client = LyDos(api_key="lyd_sk_your_key")
4# or: client = LyDos() # reads LYDOS_API_KEY env var
5 
6# Health check
7health = client.health()
8print(f"Score: {health.score}/100")
9 
10# Simple chat
11response = client.chat("What are the top AI trends in 2025?")
12print(response.text)
13print(f"Model: {response.model}, Tokens: {response.tokens_used}")

Streaming

stream.py
Python
# Stream response in real-time
for chunk in client.chat_stream("Explain blockchain in simple terms"):
print(chunk.delta, end="", flush=True)
if chunk.done:
print() # Final newline

Running Agents

agents.py
Python
1# List all agents
2agents = client.agents.list()
3for agent in agents:
4 print(f" {agent.id}: {agent.description}")
5 
6# Run a specific agent
7result = client.agents.run(
8 "security-scanner",
9 task="Scan ./src for vulnerabilities",
10 params={
11 "depth": "comprehensive",
12 "include_deps": True,
13 "output_format": "json",
14 }
15)
16print(f"Task ID: {result.task_id}")
17print(f"Status: {result.status}")

Task Polling

tasks.py
Python
1import time
2 
3# Poll until task completes
4task_id = result.task_id
5while True:
6 task = client.tasks.get(task_id)
7 print(f"Status: {task.status}")
8 
9 if task.status == "completed":
10 print(task.result)
11 break
12 elif task.status == "failed":
13 print(f"Failed: {task.error}")
14 break
15 
16 time.sleep(2)
17 
18# Or: list recent tasks
19running = client.tasks.list(status="running")
20for t in running:
21 print(f"{t.task_id}: {t.agent_id} — {t.status}")

Error Handling

error_handling.py
Python
1from lydos import (
2 LyDos,
3 LyDosError,
4 LyDosAuthError,
5 LyDosRateLimitError,
6 LyDosNotFoundError,
7)
8 
9client = LyDos(api_key="lyd_sk_your_key")
10 
11try:
12 response = client.chat("Hello, LyDos")
13except LyDosAuthError:
14 print("Invalid or expired API key")
15except LyDosRateLimitError as e:
16 print(f"Rate limit hit. Retry after {e.retry_after}s")
17except LyDosNotFoundError:
18 print("Resource not found")
19except LyDosError as e:
20 print(f"API error {e.status_code}: {e.message}")
Interactive Playground

Try it in the browser

Explore what LyDos agents return. Connect LYDOS locally to run live requests.

Click Try it to run the agent and see the live response from /api/agents/{agent}/run.

Generated SDK call:

generated.py
Python
from lydos import LyDos
 
client = LyDos() # reads LYDOS_API_KEY env var
 
result = client.agents.run(
"deep-research",
task="Research the latest AI trends in 2025",
)
print(result.task_id)