# Synchronous Example
import os
from unkey_py import Unkey

s = Unkey(
    bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)

res = s.liveness.check()

if res.object is not None:
    # handle response
    pass

The same SDK client can also be used to make asychronous requests by importing asyncio.

# Asynchronous Example
import asyncio
import os
from unkey_py import Unkey

async def main():
    s = Unkey(
        bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
    )
    res = await s.liveness.check_async()
    if res.object is not None:
        # handle response
        pass

asyncio.run(main())

Was this page helpful?