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

# Setup

> Configure the Privy Python SDK client with app credentials and authorization context for backend operations.

## Prerequisites

Before getting started:

* Obtain a [Privy app ID and app secret](/basics/get-started/dashboard/create-new-app) from the Privy Dashboard
* Install Python 3.9 or later

## Instantiating the `PrivyClient`

Import `PrivyClient` and create an instance with your Privy **app ID** and **app secret**.

```python theme={"system"}
from privy import PrivyClient

client = PrivyClient(
    app_id="your-privy-app-id",
    app_secret="your-app-secret",
)
```

This `client` is the entry point for managing Privy resources from a server. It provides services
for creating wallets, signing and sending transactions, retrieving and creating users, and managing
apps, organizations, policies, key quorums, and webhooks.

The client owns an HTTP connection pool. Close it when your application shuts down, or use it as a
context manager for shorter-lived scripts:

```python theme={"system"}
from privy import PrivyClient

with PrivyClient(
    app_id="your-privy-app-id",
    app_secret="your-app-secret",
) as client:
    # Make Privy API calls with client.
    pass
```

## Authorization

If a resource (such as a wallet, policy, or key quorum) has an
[owner](/controls/authorization-keys/using-owners/overview), requests that modify it require
[authorization signatures](/api-reference/authorization-signatures) from the owner. An
[authorization context](/controls/authorization-keys/using-owners/sign/signing-on-the-server) can
contain authorization private keys and user JWTs. The Python SDK uses the authorization context to
generate and attach the required signatures automatically.

<Tip>
  Review the [signing on the
  server](/controls/authorization-keys/using-owners/sign/signing-on-the-server) guide before using
  the Python SDK with owned resources.
</Tip>

```python theme={"system"}
from privy import AuthorizationContext, PrivyRequestOptions

request_options = PrivyRequestOptions(
    authorization_context=AuthorizationContext(
        authorization_private_keys=["private-key-1", "private-key-2"],
        user_jwts=["user-jwt-1", "user-jwt-2"],
    )
)
```

Pass `request_options=request_options` to an operation on an owned resource.

## Rate limits

Privy rate limits REST API endpoints called from a server.

<Tip>
  Learn more about optimizing request patterns and handling rate limits in the
  [optimizing](/recipes/dashboard/optimizing) guide.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/basics/python/quickstart">
    Create wallets, sign messages, and send transactions with the Python SDK.
  </Card>

  <Card title="Authorization keys" icon="key" href="/controls/authorization-keys/overview">
    Add an extra layer of security by signing requests with authorization keys.
  </Card>
</CardGroup>
