Skip to main content
The Platform Python SDK wraps authentication, workspaces, and issues in a few importable symbols.
import os
from praisonaiagents import Agent
from praisonai_platform import PlatformClient, create_app

agent = Agent(
    name="platform-assistant",
    instructions="Help users manage workspace issues.",
)

async with PlatformClient(
    os.getenv("PLATFORM_URL", "http://localhost:8000"),
    token=os.getenv("PLATFORM_TOKEN"),
) as client:
    workspace = await client.create_workspace("My Team")
The user manages team work; the agent creates workspaces and issues via the platform SDK.

How It Works

Quick Start

1

Simple Usage

Install and register a user:
pip install praisonai-platform
import asyncio
from praisonai_platform import PlatformClient

async def main():
    async with PlatformClient("http://localhost:8000") as client:
        await client.register("user@example.com", "password")
        workspaces = await client.list_workspaces()
        print(workspaces)

asyncio.run(main())
2

With Configuration

Deploy the API server and connect with a stored token:
import os
from praisonai_platform import PlatformClient, create_app

# Run the server (uvicorn praisonai_platform:app)
app = create_app()

client = PlatformClient(
    base_url=os.getenv("PLATFORM_URL", "http://localhost:8000"),
    token=os.getenv("PLATFORM_TOKEN"),
)

How It Works

ExportPurpose
create_app()FastAPI factory for self-hosted Platform API
PlatformClientAsync HTTP client with JWT handling
__version__Package version string
from praisonai_platform import __version__
print(__version__)

Configuration Options

ParameterTypeDefaultDescription
base_urlstrPlatform API base URL
tokenstrNoneJWT bearer token (auto-set after login)

Best Practices

async with PlatformClient(...) reuses a connection pool for multiple calls.
After register() or login(), the client stores the JWT automatically.
Set PLATFORM_URL and PLATFORM_TOKEN in production — avoid hardcoded URLs.
Import __version__ at startup when you depend on specific API behaviour.

Platform SDK Client

Complete PlatformClient method reference

Platform Authentication

Register, login, and JWT management