> ## 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 .NET SDK

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

* Package: [`Leadping.OpenApiClient`](https://www.nuget.org/packages/Leadping.OpenApiClient)
* Repository: [`leadpingai/leadping-dotnet`](https://github.com/leadpingai/leadping-dotnet)

## Install

```bash theme={null}
dotnet add package Leadping.OpenApiClient
dotnet add package Microsoft.Kiota.Http.HttpClientLibrary
```

## Create the client

```csharp theme={null}
using Leadping.OpenApiClient;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;

var credential = Environment.GetEnvironmentVariable("LEADPING_API_KEY")
    ?? throw new InvalidOperationException("LEADPING_API_KEY is not set.");

var authProvider = new ApiKeyAuthenticationProvider(
    $"Bearer {credential}",
    "Authorization",
    ApiKeyAuthenticationProvider.KeyLocation.Header,
    ["api.leadping.ai"]);
var client = new LeadpingOpenApiClient(new HttpClientRequestAdapter(authProvider));
var lead = await client.Leads["lead-id"].GetAsync();
```

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

```csharp theme={null}
var source = await client.Sources["source-id"].GetAsync();
var lead = await client.Leads["lead-id"].GetAsync();
// Requires a user access token.
var currentUser = await client.Users.Me.GetAsync();
```

Use generated request-body and model classes from `Leadping.OpenApiClient` 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).
