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.8.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.8-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openfinclaw-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 8794ae6ddce0e0fd7f2ab182f5fedcd39965ca73efcb2aa9884401c612fdc2df
MD5 f5879500dff84c41ad58fd2e5efee1ad
BLAKE2b-256 584f4207cd63d55322cab54903aef99fd21edb642d8294e21b6a061c076ba7de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openfinclaw-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4985720dcea212a26a88b770240be4d83aea4bb1235ae8fe4b3069d5e940ad9b
MD5 1f1612986734799f586a432e4da27831
BLAKE2b-256 ff40536d039d21b8a3debd6e3747f0475ab6b6b48f392735436a7d5c319d3e86

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