Build with LyDos SDK
Official SDKs for Python, TypeScript, and Go. Stream responses, run 100+ agents, and integrate with your stack in minutes.
Get started in seconds
Install the SDK for your language of choice. Requires an API key from your settings page.
| # 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 |
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.
Real examples. Production-ready.
Browse examples by language. All snippets are copy-paste ready.
Quick Start
| 1 | from lydos import LyDos |
| 2 | |
| 3 | client = LyDos(api_key="lyd_sk_your_key") |
| 4 | # or: client = LyDos() # reads LYDOS_API_KEY env var |
| 5 | |
| 6 | # Health check |
| 7 | health = client.health() |
| 8 | print(f"Score: {health.score}/100") |
| 9 | |
| 10 | # Simple chat |
| 11 | response = client.chat("What are the top AI trends in 2025?") |
| 12 | print(response.text) |
| 13 | print(f"Model: {response.model}, Tokens: {response.tokens_used}") |
Streaming
| # 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
| 1 | # List all agents |
| 2 | agents = client.agents.list() |
| 3 | for agent in agents: |
| 4 | print(f" {agent.id}: {agent.description}") |
| 5 | |
| 6 | # Run a specific agent |
| 7 | result = 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 | ) |
| 16 | print(f"Task ID: {result.task_id}") |
| 17 | print(f"Status: {result.status}") |
Task Polling
| 1 | import time |
| 2 | |
| 3 | # Poll until task completes |
| 4 | task_id = result.task_id |
| 5 | while 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 |
| 19 | running = client.tasks.list(status="running") |
| 20 | for t in running: |
| 21 | print(f"{t.task_id}: {t.agent_id} — {t.status}") |
Error Handling
| 1 | from lydos import ( |
| 2 | LyDos, |
| 3 | LyDosError, |
| 4 | LyDosAuthError, |
| 5 | LyDosRateLimitError, |
| 6 | LyDosNotFoundError, |
| 7 | ) |
| 8 | |
| 9 | client = LyDos(api_key="lyd_sk_your_key") |
| 10 | |
| 11 | try: |
| 12 | response = client.chat("Hello, LyDos") |
| 13 | except LyDosAuthError: |
| 14 | print("Invalid or expired API key") |
| 15 | except LyDosRateLimitError as e: |
| 16 | print(f"Rate limit hit. Retry after {e.retry_after}s") |
| 17 | except LyDosNotFoundError: |
| 18 | print("Resource not found") |
| 19 | except LyDosError as e: |
| 20 | print(f"API error {e.status_code}: {e.message}") |
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:
| 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) |