Misar Docs
MisarMailMisar.BlogMisarReachMisarPostMisar.DevMisar PlatformMisar IdentityMisar Posts API
Sdks

Python SDK

Official Misar.Dev SDK for Python — build, deploy, and manage apps via api.misar.io/dev.

The official Misar.Dev client SDK for Python. The client is async (built on httpx.AsyncClient) and targets Python 3.9+. This is an early v0.1.0 port implementing a subset of the reference SDK.

Installation

pip install misar-dev

The package is named misar-dev; the import module is misardev. It depends on httpx and pydantic.

Quick start

import asyncio
from misardev import MisarDevClient

async def main():
    client = MisarDevClient("your-api-key")
    result = await client.projects_create(name="my-app")
    print(result)
    await client.aclose()

asyncio.run(main())

Configuration

client = MisarDevClient(
    "your-api-key",
    base_url="https://api.misar.io/dev",
    max_retries=3,
    timeout=30.0,
)
ArgumentTypeDefault
api_keystr— (required, positional)
base_urlstrbase API URL
max_retriesint3
timeoutfloat30.0
http_clienthttpx.AsyncClient | NoneNone (auto-created)

Requests send Authorization: Bearer <api_key>. Responses with status 429, 500, 502, 503, or 504 are retried with exponential backoff. Call await client.aclose() to release the underlying HTTP client.

Resources

All methods are coroutines and return parsed JSON dicts. The port uses flat method names (not nested resource objects).

MethodDescription
projects_list(**params)List projects
projects_create(**data)Create a project (e.g. name=...)
projects_get(project_id)Get a project
projects_delete(project_id)Delete a project
api_keys_list()List API keys
api_keys_create(name)Create an API key
templates_list()List templates
usage_get(**params)Get usage summary
chat_complete(messages, **kwargs)Run a chat completion
billing_checkout(plan, success_url, cancel_url)Create a checkout session

This port covers projects, API keys, templates, usage, chat, and billing checkout. Project deploy, templates CRUD, RAG, and analytics are available in the TypeScript SDK.

Error handling

from misardev import MisarDevError, MisarDevNetworkError

try:
    await client.projects_get("missing-id")
except MisarDevNetworkError as err:
    print("network failure:", err)
except MisarDevError as err:
    print(err.status, err.error_type)

MisarDevError carries .status and .error_type. MisarDevNetworkError extends it (status 0) and exposes the original exception via .cause.