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

# Python and TS Cheat Sheets

> Copy-ready Python and TypeScript examples for common Darwin SDK operations.

Use these side-by-side examples to translate common Darwin operations between Python and TypeScript. Set `DARWIN_API_KEY` in your server environment before running them.

## Create a client

<CodeGroup>
  ```python Python theme={null}
  import os
  from darwin_sdk import Darwin

  client = Darwin(token=os.environ["DARWIN_API_KEY"])
  ```

  ```typescript TypeScript theme={null}
  import { DarwinClient } from '@darwinso/sdk';

  const client = new DarwinClient({
    token: process.env.DARWIN_API_KEY!,
  });
  ```
</CodeGroup>

## Send a routed message

<CodeGroup>
  ```python Python theme={null}
  turn = client.conversations.create_message(
      content="Show me the requests that need my attention.",
  )
  ```

  ```typescript TypeScript theme={null}
  const turn = await client.conversations.createMessage({
    content: 'Show me the requests that need my attention.',
  });
  ```
</CodeGroup>

## List agents and goals

<CodeGroup>
  ```python Python theme={null}
  agents = client.agents.list_agents().agents
  agent = agents[0]

  goals = client.goals.list_goals(agent_id=agent.id)
  ```

  ```typescript TypeScript theme={null}
  const { agents } = await client.agents.listAgents();
  const agent = agents[0];

  const goals = await client.goals.listGoals({ agentId: agent.id });
  ```
</CodeGroup>

## Inspect skills

<CodeGroup>
  ```python Python theme={null}
  catalog = client.agents.list_skill_catalog()
  skills = client.agents.list_agent_skills(agent_id=agent.id)
  ```

  ```typescript TypeScript theme={null}
  const catalog = await client.agents.listSkillCatalog();
  const skills = await client.agents.listAgentSkills({ agentId: agent.id });
  ```
</CodeGroup>

## Review requests

<CodeGroup>
  ```python Python theme={null}
  requests = client.requests.list_requests(agent_id=agent.id)
  ```

  ```typescript TypeScript theme={null}
  const requests = await client.requests.listRequests({
    agentId: agent.id,
  });
  ```
</CodeGroup>

## Common method names

| Operation             | Python                             | TypeScript                        |
| --------------------- | ---------------------------------- | --------------------------------- |
| Get account           | `account.get_account()`            | `account.getAccount()`            |
| List agents           | `agents.list_agents()`             | `agents.listAgents()`             |
| List skills           | `agents.list_agent_skills()`       | `agents.listAgentSkills()`        |
| List requests         | `requests.list_requests()`         | `requests.listRequests()`         |
| Send a routed message | `conversations.create_message()`   | `conversations.createMessage()`   |
| List goals            | `goals.list_goals()`               | `goals.listGoals()`               |
| List deals            | `deals.list_deals()`               | `deals.listDeals()`               |
| List connected apps   | `applications.list_applications()` | `applications.listApplications()` |

<Info>
  **Connect** is the product name for connected applications. The current generated SDK property remains `applications` for API compatibility.
</Info>

For configuration, retries, and async behavior, see the [Python SDK specification](/sdks/python-specification) and [TypeScript SDK specification](/sdks/typescript-specification).
