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

# Use the Python SDK

> Install the Leadping Python SDK, supply a Kiota request adapter, and call typed API routes.

* Package: [`leadping`](https://pypi.org/project/leadping/)
* Repository: [`leadpingai/leadping-python`](https://github.com/leadpingai/leadping-python)

## Install

```bash theme={null}
pip install leadping microsoft-kiota-http
```

## Create the client

```python theme={null}
import os
from kiota_abstractions.authentication.api_key_authentication_provider import (
    ApiKeyAuthenticationProvider,
    KeyLocation,
)
from kiota_http.httpx_request_adapter import HttpxRequestAdapter
from leadping import LeadpingOpenApiClient

credential = os.environ["LEADPING_API_KEY"]
auth_provider = ApiKeyAuthenticationProvider(
    KeyLocation.Header,
    f"Bearer {credential}",
    "Authorization",
    ["api.leadping.ai"],
)
client = LeadpingOpenApiClient(HttpxRequestAdapter(auth_provider))
lead = await client.leads.by_id("lead-id").get()
```

The client defaults to `https://api.leadping.ai`. Set `LEADPING_API_KEY` to an organization API key. `client.users.me` requires a user access token; source keys are only for lead intake.

The SDK does not store or refresh credentials. See [API Authentication](/docs/api-authentication).

## Call routes

```python theme={null}
source = await client.sources.by_id("source-id").get()
lead = await client.leads.by_id("lead-id").get()
# Requires a user access token.
current_user = await client.users.me.get()
```

Use generated request-body and model classes from `leadping` when creating or updating records. Confirm endpoint contracts in the [API Reference](/docs/api-reference), and handle `429` responses using the [rate-limit guide](/docs/rate-limits).
