> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dedaluslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Learn how to build, run, and deploy agents with the Dedalus SDK in minutes

Dedalus helps you ship agent workflows that are:

* **Provider-agnostic**: Use OpenAI, Anthropic, Google, xAI, DeepSeek, and more with one API.
* **Tool- and MCP-native**: Let models call local functions and hosted MCP servers.
* **Production-ready**: Streaming, structured outputs, routing/handoffs, and runtime policies.

## What are you trying to build?

<CardGroup cols={2}>
  <Card title="Chat with a model" icon="message-square" href="/sdk/chat">
    Send a prompt and get a response from any provider/model.
  </Card>

  <Card title="Equip a model with tools" icon="wrench" href="/sdk/tools">
    Let the model call typed Python/TS functions that you implement.
  </Card>

  <Card title="Stream agent output" icon="zap" href="/sdk/streaming">
    Print responses as they're generated (great for UIs/CLIs).
  </Card>

  <Card title="Get reliable JSON" icon="braces" href="/sdk/structured-outputs">
    Validate model output against schemas (Pydantic/Zod).
  </Card>

  <Card title="Route across models" icon="shuffle" href="/sdk/handoffs">
    Provide multiple models; the agent can route/handoff by phase.
  </Card>

  <Card title="Generate images" icon="image" href="/sdk/images">
    DALL-E generation, edits, variations, and vision analysis.
  </Card>
</CardGroup>

## Installation

<CodeGroup>
  ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  uv pip install dedalus-labs
  ```

  ```bash npm theme={"theme":{"light":"github-light","dark":"github-dark"}}
  npm install dedalus-labs
  ```

  ```bash yarn theme={"theme":{"light":"github-light","dark":"github-dark"}}
  yarn add dedalus-labs
  ```

  ```bash pnpm theme={"theme":{"light":"github-light","dark":"github-dark"}}
  pnpm add dedalus-labs
  ```

  ```bash bun theme={"theme":{"light":"github-light","dark":"github-dark"}}
  bun add dedalus-labs
  ```
</CodeGroup>

## Set Your API Key

Get your API key from the [dashboard](https://dedaluslabs.ai/dashboard/api-keys) and set it as an environment variable:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export DEDALUS_API_KEY="your-api-key"
```

Or use a `.env` file:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
DEDALUS_API_KEY=your-api-key
```

## Your First Request

Let's build this incrementally.

### 1) Chat with a model

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import asyncio
from dedalus_labs import AsyncDedalus, DedalusRunner
from dotenv import load_dotenv

load_dotenv()

async def main():
    client = AsyncDedalus()
    runner = DedalusRunner(client)

    response = await runner.run(
        input="What are the key factors that influence weather patterns?",
        model="openai/gpt-5.4",
    )

    print(response.final_output)

if __name__ == "__main__":
    asyncio.run(main())
```

### 2) Add an MCP server

Here we connect a well-known MCP server and let the model use it.

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import asyncio
from dedalus_labs import AsyncDedalus, DedalusRunner
from dotenv import load_dotenv

load_dotenv()

async def main():
    client = AsyncDedalus()
    runner = DedalusRunner(client)

    response = await runner.run(
        input="What's the weather forecast for San Francisco this week?",
        model="openai/gpt-5.4",
        mcp_servers=["windsornguyen/open-meteo-mcp"],  # Weather forecasts via Open-Meteo
    )

    print(response.final_output)

if __name__ == "__main__":
    asyncio.run(main())
```

### 3) Add a local tool

Define a function with type hints and a docstring. Pass it to `runner.run()`. The SDK extracts the schema automatically and handles execution when the model decides to use it.

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import asyncio
from dedalus_labs import AsyncDedalus, DedalusRunner
from dotenv import load_dotenv

load_dotenv()

def as_bullets(items: list[str]) -> str:
    """Format items as a bulleted list."""
    return "\n".join(f"• {item}" for item in items)

async def main():
    client = AsyncDedalus()
    runner = DedalusRunner(client)

    response = await runner.run(
        input=(
            "Get the 7-day weather forecast for San Francisco "
            "and format the daily conditions as bullets using as_bullets."
        ),
        model="openai/gpt-5.4",
        mcp_servers=["windsornguyen/open-meteo-mcp"],
        tools=[as_bullets],
    )

    print(response.final_output)

if __name__ == "__main__":
    asyncio.run(main())
```

### 4) Stream output

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import asyncio
from dedalus_labs import AsyncDedalus, DedalusRunner
from dedalus_labs.utils.stream import stream_async
from dotenv import load_dotenv

load_dotenv()

async def main():
    client = AsyncDedalus()
    runner = DedalusRunner(client)

    stream = runner.run(
        input="Explain how weather forecasting works in one paragraph, streaming as you write.",
        model="openai/gpt-5.4",
        stream=True,
    )

    await stream_async(stream)

if __name__ == "__main__":
    asyncio.run(main())
```

## Next steps

<CardGroup cols={2}>
  <Card title="Use Cases" icon="lightbulb" href="/sdk/use-cases/web-search-agent">
    Start from common agent patterns and templates.
  </Card>

  <Card title="Cookbook" icon="book" href="/sdk/cookbook/multi-turn-chat">
    End-to-end implementations and working recipes.
  </Card>
</CardGroup>

**Go deeper**: [Tools](/sdk/tools) · [MCP Servers](/sdk/mcp) · [Structured Outputs](/sdk/structured-outputs) · [Streaming](/sdk/streaming)

## Get the latest SDKs

<CardGroup cols={2}>
  <Card title="Python SDK" icon="github" href="https://github.com/dedalus-labs/dedalus-sdk-python">
    dedalus-labs/dedalus-sdk-python
  </Card>

  <Card title="TypeScript SDK" icon="github" href="https://github.com/dedalus-labs/dedalus-sdk-typescript">
    dedalus-labs/dedalus-sdk-typescript
  </Card>
</CardGroup>

<Tip>
  [Connect these docs programmatically](/contextual/use-these-docs) to Claude, VSCode, and more via
  MCP for real-time answers.
</Tip>
