Skip to main content
The Python SDK (meerkat-sdk) is a runtime-backed client over rkat-rpc.
  • Contract version: 0.8.22
  • Python: >=3.10
  • Runtime dependencies: websockets>=12,<16

Install

For local development:

Quick start

Method overview

Session lifecycle

  • await client.create_session(...) -> Session
  • client.create_session_streaming(...) -> EventStream
  • await client.create_deferred_session(...) -> DeferredSession
  • await client.list_sessions(...) -> list[SessionSummary]
  • await client.read_session(session_id) -> SessionDetails
  • await client.read_session_history(session_id, offset=0, limit=None) -> SessionHistory

Session runtime inputs

  • await client.inject_context(session_id, text, source=None, idempotency_key=None)
  • await session.inject_context(...)
  • await client.send_external_event(session_id, event_type, payload, blocks=None)
  • await session.send_external_event(event_type, payload, blocks=None)

Turn APIs

Session.turn(...), Session.stream(...), and DeferredSession.start_turn(...) support:
  • skill_refs, turn_tool_overlay
  • additional_instructions
  • keep_alive, model, provider, max_tokens, system_prompt
  • output_schema, structured_output_retries, provider_params

Config APIs

  • await client.get_config() -> ConfigEnvelope
  • await client.set_config(config, expected_generation=None) -> ConfigWriteResult
  • await client.patch_config(patch, expected_generation=None) -> ConfigWriteResult
All config APIs return an envelope (config, generation, realm metadata), not a bare config object; writes additionally carry live_propagation.

Additional runtime surfaces

  • await client.get_models_catalog()
  • await client.create_schedule(...)
  • await client.get_schedule(...)
  • await client.list_schedules(labels=None, limit=None, offset=None)
  • await client.update_schedule(...)
  • await client.pause_schedule(...)
  • await client.resume_schedule(...)
  • await client.delete_schedule(...)
  • await client.list_schedule_occurrences(...)
  • await client.list_schedule_tools()
  • await client.call_schedule_tool(...)

Live channel APIs

The old RealtimeChannel helper has been removed. Use LiveChannel.session(...) for a session-bound wrapper, or call the direct live/* RPC helpers on MeerkatClient.
  • await client.live_open(session_id, turning_mode=None, transport=None, seed_max_chars=None)
  • await client.live_status(channel_id)
  • await client.live_close(channel_id)
  • await client.live_send_input_text(channel_id, text)
  • await client.live_send_input_audio(channel_id, data_base64, sample_rate_hz, channels)
  • await client.live_send_input_image(channel_id, idempotency_key, mime, data_base64)
  • await client.live_send_input_video_frame(channel_id, codec, data_base64, timestamp_ms)
  • await client.live_commit_input(channel_id, response_modality=None)
  • await client.live_interrupt(channel_id)
  • await client.live_truncate(channel_id, item_id, content_index, audio_played_ms)
  • await client.live_refresh(channel_id)
Image keys are required, caller-stable, and session-scoped. The helper returns after queue acceptance; wait for user_content_committed with the matching key before treating the image as durable context. See Live Channels for replay, conflict, and reconnect limits. seed_max_chars is an optional positive serialized-character budget for a core-selected whole-turn seed suffix. Omit it for the full canonical seed. Every ordered System message must fit. Runtime context and complete image identity, tombstone, and accounting sidecars remain outside the window; any truncation reports degraded continuity. Zero is rejected by the server.

Mob APIs

  • await client.create_mob(...) -> Mob
  • await client.list_mobs()
  • await mob.spawn(...)
  • await mob.spawn_many(...)
  • await mob.read_events(after_cursor=0, limit=100)
  • await mob.wait_for_kickoff_complete(...)
  • await mob.spawn_helper(..., role_name=...)
  • await mob.fork_helper(..., role_name=...)

Realm profile CRUD

  • await client.create_mob_profile(name, profile)
  • await client.get_mob_profile(name) -> StoredMobProfile | None
  • await client.list_mob_profiles()
  • await client.update_mob_profile(name, profile, expected_revision=...)
  • await client.delete_mob_profile(name, expected_revision=...)

Additional wrappers

The Python client also exposes:
  • realm helpers: list_realms(), get_realm(...)
  • auth helpers: list_auth_profiles(...), get_auth_profile(...), create_auth_profile(...), delete_auth_profile(...), auth_login_*, auth_provision_api_key(...), auth_status(...), auth_logout(...)
  • blob/skill/MCP helpers: get_blob(...), list_skills(), mcp_add(...), mcp_remove(...), mcp_reload(...)
  • comms helpers: session.send(...), session.peers()
  • typed ingress helpers: send_peer_response_terminal(...)

Generated assistant images

When a session model calls the built-in generate_image tool, generated images appear in committed history as SessionAssistantBlock entries with block_type == "image". The SDK preserves image_id, blob_id, media_type, width, height, revised_prompt, and provider metadata.
Image-generation wire contracts are also exported for integrations that inspect tool results directly: WireGenerateImageRequest, WireGenerateImageExecutionPlan, WireImageGenerationToolResult, WireImageOperationPhase, and WireAssistantImageRef.

Typed session metadata

  • SessionSummary (from session/list) includes total_tokens
  • SessionDetails (from session/read) includes model, provider, last_assistant_text
  • both use integer unix timestamps for created_at / updated_at

Streaming model

EventStream is an async context manager returned by session.stream() and client.create_session_streaming(). Iterate it to receive typed event dataclasses, then read events.result.