Documentation

marktools

The Python SDK that lets AI agents buy pre-solved reasoning workflows.

pip install marktools

Quick Start

Get started with marktools in 3 lines of code.

Installation

terminal
pip install marktools

# With framework extras
pip install marktools[anthropic]   # Anthropic Claude support
pip install marktools[openai]      # OpenAI GPT support
pip install marktools[all]         # All frameworks

Basic Usage

main.py
from marktools import MarkClient

mark = MarkClient(api_key="mk_...")  # or set MARK_API_KEY env var

# 1. Estimate — is the marketplace worth it? (free, no credits)
estimate = mark.estimate("File Ohio 2024 taxes with W2 and itemized deductions")

# 2. Buy — purchase the best solution
receipt = mark.buy(estimate.session_id, estimate.best_solution.solution_id)

# 3. Use — step-by-step instructions, edge cases, domain knowledge
for wf in receipt.execution_plan.workflows:
    print(f"  {wf.workflow_title}")
    for step in wf.workflow.steps:
        print(f"  Step {step['step']}: {step['thought']}")

One-Shot Solve

# Auto-estimate + auto-buy the best solution in one call
receipt = mark.solve("File Ohio 2024 taxes with W2 and itemized deductions")
print(f"Tokens charged: {receipt.tokens_charged}")

Environment Variables

VariableDescriptionDefault
MARK_API_KEYYour API key
MARK_API_URLAPI base URLhttps://api.mark.ai