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

# Control Plane

> Use the Tensormesh Python SDK for users, billing, support, observability, and pagination-aware workflows.

Use the Control Plane SDK surface when you are managing Tensormesh resources instead of sending inference requests.

Common tasks include:

* reading the current user profile or API keys
* checking balance, transactions, and support tickets
* accessing admin or observability APIs from application code

The control-plane SDK surface lives under `client.control_plane`.

Use it with a control-plane bearer token:

```python theme={null}
from tensormesh import Tensormesh

client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
```

When you compare this guide to the generated Control Plane reference, remember that some mixed resource families include both standard and admin routes, and some internal-only routes such as Stripe webhook delivery are intentionally omitted from the public SDK surface.

## Start With Common Read-Only Tasks

```python theme={null}
from tensormesh import Tensormesh

client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")

profile = client.control_plane.users.get_auth_profile()
api_keys = client.control_plane.users.api_keys.list()

print(profile.display_name)
print([item.name for item in api_keys])
```

## Check Billing And Support

```python theme={null}
from tensormesh import Tensormesh

client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")

balance = client.control_plane.billing.balance.get()
tickets = client.control_plane.support.tickets.list(size=20)

print(balance.units if balance is not None else "0")
print([ticket.subject for ticket in tickets.tickets])
```

## Stripe Billing Flows

```python theme={null}
from tensormesh import Tensormesh

client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")

customer = client.control_plane.billing.stripe.customer.get_or_create()
payment_methods = client.control_plane.billing.stripe.payment_methods.list()
setup_intent = client.control_plane.billing.stripe.setup_intents.create()

print(customer.stripe_customer_id)
print(payment_methods.stripe_payment_method_ids)
print(setup_intent.client_secret)
```

## Auto-Pagination

Use `auto_paging_iter(...)` on paged resources when you want items instead of manual page handling.

```python theme={null}
from tensormesh import Tensormesh

client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")

for transaction in client.control_plane.billing.transactions.auto_paging_iter(
    page_size=100,
):
    print(transaction.transaction_id, transaction.amount)
```

## Async Control Plane Usage

```python theme={null}
import asyncio

from tensormesh import AsyncTensormesh


async def main() -> None:
    async with AsyncTensormesh(
        control_plane_token="YOUR_CONTROL_PLANE_TOKEN",
    ) as client:
        tickets = await client.control_plane.support.tickets.list(size=20)
        print([ticket.subject for ticket in tickets.tickets])


asyncio.run(main())
```

## Related Guides

* [Getting Started](/sdk/guides/getting-started)
* [Auth And Config](/sdk/guides/auth-and-config)
* [Inference](/sdk/guides/inference)

## Related Reference

Use the **Control Plane API** tab in the docs navigation for generated management API reference.
