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

> ## Agent Instructions
> Reconify's API reference is read-only for customer data. Do not invent endpoints or authentication behavior beyond the OpenAPI contract.
> The public OpenAPI document contains only the documented external /v2 contract.

# Python quickstart

> Install the Python SDK and send your first monitoring event.

`reconify-python` is a server-side client for Python 3.10 or newer. It needs a `write` or
`admin` key, which [Authentication](/reference/api/authentication) covers.

<Warning>
  Reconify has no sandbox or test mode. The event you send below becomes immutable evidence
  in your real organization, and the public API deletes nothing.
</Warning>

## Install

The distribution installs from PyPI:

```bash pip theme={"theme":{"light":"github-light","dark":"github-dark"}}
pip install reconify-python
```

The distribution is `reconify-python`, and the import name is `reconify`.

## Configure a client

A client holds the key and the base URL:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import os

from reconify import Reconify

client = Reconify(api_key=os.environ["RECONIFY_API_KEY"])
```

The client reads `RECONIFY_API_KEY` and `RECONIFY_API_URL` when you omit
`api_key` and `base_url`. The default base URL is
`https://api.reconifyhq.com/v2`, and the client appends `/v2` when your value omits it.

<Warning>
  The constructor raises `ReconifyValidationError` when the key is missing or does
  not start with `rk_`. This happens before any network call, so a misconfigured
  deployment fails at startup rather than at the first event.
</Warning>

Both clients hold an HTTP connection pool, so they work as context managers. Outside a
context manager, `Reconify` needs `close()` and `AsyncReconify` needs `await aclose()`.

## Send one event

Request fields use the wire format, and `amount` is a decimal string such as `"150.00"`
rather than a float:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from datetime import datetime, timezone

from reconify import Reconify
from reconify.models import MonitoringBatchRequest, MonitoringEvent

batch = MonitoringBatchRequest(
    events=[
        MonitoringEvent(
            id="evt_01J3Y0M8VJQ5W1R3E4J4K7N8P9",
            flow="payment_to_wallet",
            type="payment.succeeded",
            occurred_at=datetime(2026, 1, 1, 12, 0, tzinfo=timezone.utc),
            amount="150.00",
            currency="USD",
            reference="order-123",
            entity_id="wallet_123",
        )
    ]
)

with Reconify() as client:
    result = client.ingestion.ingest_monitoring_events(batch)

    for item in result.results:
        print(item.index, item.status, item.event_id or item.code)
```

<Check>
  Each result is `accepted`, `duplicate`, or `rejected`, and its `index` matches
  the position of the event you sent. `accepted` means Reconify stored the event.
  It does not mean the monitored operation is complete.
</Check>

## Field names

Model fields use the wire format, not Python casing conventions applied to
something else: send `occurred_at`, `entity_id`, and `type`.

`amount` is a decimal **string**, such as `"150.00"`. Passing a `float` fails
model validation. Format money from `Decimal`, never from `float` arithmetic.

One name differs between request and response: you send `type`, and an event
read returns `event_type`.

Request models reject unknown fields before sending. That turns a typo into an
immediate `ReconifyValidationError` instead of a rejected event.

## Use the async client

`AsyncReconify` exposes the same modules and method names.

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import asyncio

from reconify import AsyncReconify


async def main() -> None:
    async with AsyncReconify() as client:
        result = await client.ingestion.ingest_monitoring_events(batch)
        print(result.results)


asyncio.run(main())
```

## Read the event back

A read confirms what Reconify stored:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
with Reconify() as client:
    event = client.events.get_event("evt_01J3Y0M8VJQ5W1R3E4J4K7N8P9")
    print(event.event_type, event.status)
```

## Next

Build batches, handle every item result, and retry safely in
[Send events with Python](/sdks/python/send-events).
