Skip to main content

OpenFinClaw SDK — Python client & CLI for the DeepAgent API

Project description

OpenFinClaw SDK

AI-powered financial analysis agent. Ask questions in natural language, get professional research reports.

Quick Start

CLI (Interactive Terminal)

pip install openfinclaw[cli]
openfinclaw-cli

That's it. Type your question and get analysis:

You: 分析宁德时代的投资价值
Assistant: ...

Python SDK (Programmatic)

pip install openfinclaw
from openfinclaw import OpenFinClawClient

client = OpenFinClawClient()

# Create a conversation thread
thread = client.create_thread()

# Stream the response
for event in client.stream(thread.id, "分析宁德时代的投资价值"):
    if event.type == "TEXT_DELTA":
        print(event.text, end="", flush=True)

Features

  • Multi-turn conversations — context is preserved across messages
  • Real-time streaming — see the response as it's generated (SSE)
  • 58+ financial skills — stock analysis, macro, crypto, derivatives, backtesting, and more
  • Multi-agent architecture — specialized agents (analyst, researcher, risk manager, strategist) collaborate on your query

CLI Commands

Command Description
/new Create a new conversation thread
/threads List all threads
/history Show message history
/runs Show run history
/cancel Cancel the active run
/help Show available commands
/quit Exit

SDK API Reference

client = OpenFinClawClient(api_key="your-key", base_url="https://api.openfinclaw.ai/agent")

# Thread management
thread = client.create_thread(title="My Analysis")
threads = client.list_threads()

# Messages & Runs
messages = client.list_messages(thread.id)
runs = client.list_runs(thread.id)
client.cancel_run(thread.id, run.id)

# Streaming (returns Iterator[Event])
for event in client.stream(thread.id, "your question"):
    match event.type:
        case "TEXT_DELTA":    print(event.text)       # response text chunk
        case "TOOL_START":    print(event.tool_name)   # tool being called
        case "TOOL_DONE":     ...                      # tool finished
        case "AGENT_HANDOFF": print(event.agent_name)  # agent delegation
        case "RUN_FINISHED":  ...                      # done
        case "ERROR":         print(event.error)       # error occurred

Error Handling

from openfinclaw import OpenFinClawClient, RateLimitError, AuthError

client = OpenFinClawClient()
try:
    for event in client.stream(thread.id, "question"):
        ...
except RateLimitError:
    print("Daily limit reached (30/day)")
except AuthError:
    print("Invalid API key")

Example Use Cases

A-share

You: 300750 宁德时代深度分析 — 固态电池进展和估值
You: 今天A股有哪些热门板块和涨停股?龙虎榜有什么异动?
You: 人形机器人概念还能追吗?当前处于炒作周期的什么阶段?
You: 用双均线策略回测沪深300,过去一年表现如何?

US Stock

You: NVDA 英伟达 Q4 财报分析,AI 算力需求是否见顶?
You: 对比 TSLA vs BYD,谁的估值更有吸引力?
You: 美联储降息周期下,哪些美股板块最受益?

Crypto & Macro

You: BTC 当前处于减半周期的什么阶段?山寨季来了吗?
You: 当前中国宏观经济形势如何?CPI/PPI/PMI 趋势
You: 帮我构建一个攻守兼备的A股ETF组合

Limits

  • 30 requests/day per API key
  • Beta access expires on the date specified by your key

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openfinclaw-0.1.6.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openfinclaw-0.1.6-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file openfinclaw-0.1.6.tar.gz.

File metadata

  • Download URL: openfinclaw-0.1.6.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for openfinclaw-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d8c7b8becb73d9553e224d7858ec19b84f6227edd2bb480f13a67daaf9d74920
MD5 31bbb70417bcfd9a35419abfebbdf5d8
BLAKE2b-256 3890f0cf3451c993190db807b2b8267df7f1857d2576154b3958bbba5db575c8

See more details on using hashes here.

File details

Details for the file openfinclaw-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: openfinclaw-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for openfinclaw-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bd92be25332434f12c15e24f010b453d742a44499f0f06277d5f4bfaa1acc7e9
MD5 d702fae0b6d9d275879d45b8feb5dd66
BLAKE2b-256 d96293605561b2f014af971e1c84fd2b6a1faaeff62756a1fba54cfbc2e266db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page