Financial-API AGENTS.md

Repository instructions for agents working with the HiThink Finance API, command-line tool, Python code, and documentation. They explain the project's monorepo structure, meaning one repository containing several related projects.

In plain words
What is it for?
Use them when starting financial-data work in the repository, especially when deciding between the command-line tool, hosted tools, REST API, or Python toolkit.
Why use it?
They help an agent choose the correct interface, stay within the right project area, read required instructions, and use API credentials consistently.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/hithink-tech/financial-api/agents-md
Clone the repo
git clone --depth 1 https://github.com/HiThink-Tech/Financial-API

Made for: Codex, OpenCode.

Per session 1,319 This file is loaded in full into every session.
When invoked 1,319 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01319 $0.01319
Opus 5 $0.00660 $0.00660
Sonnet 5 $0.00264 $0.00264
Haiku 4.5 $0.00132 $0.00132

Measured 2d ago against content hash 608dcf7fe7b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Financial-API AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

任何 AI coding/data Agent 进入本仓库后的公开入口。项目品牌为“同花顺金融数据服务(hithink finance)”。

必读顺序

  1. 旧 checkout、旧 Prompt 或旧根级 Python 路径:先读 docs/monorepo-migration.md
  2. 所有金融数据任务:先读 skills/hithink-finance/SKILL.md
  3. 只加载 Skill 选择的一个接入方式或端点组,不要递归读取全部契约。

Monorepo 边界

  • hithink-finance-cli/:Node.js CLI 子项目,面向人类、Agent 和自动化;运行时不依赖 Python。
  • python/:唯一 Python 项目根,包含远端取数 toolkit、本地 marketdb、示例和测试。
  • docs/:公共文档中心;docs/api/ 是仓库内唯一上游 REST API 契约源。
  • skills/hithink-finance/:可独立发布的统一 Skill;API/MCP 契约由脚本从 docs/ 镜像。
  • examples/:monorepo 级示例导航与静态灵感。

选择接入方式

场景 优先入口
人类终端、Agent 执行、自动化、远端+本地一体化 hithink-finance CLI
已连接 MCP 的 Chat 场景 托管 MCP
零依赖 HTTP、自定义语言或服务端 REST API
Python/Notebook/研究或已有 marketdb Python toolkit/SDK

CLI 已安装时先运行 hithink-finance capabilities --format json,再按需运行 schema <id>;MCP 以实时 tools/list 为准;REST 响应字段以 docs/api/ 及远端 https://fuyao.aicubes.cn/llms-full.txt 为准;Python 适配层参数以当前函数签名和 --help 为准。

API Key

所有远端接入方式使用在 https://fuyao.aicubes.cn/admin 获取的统一 API Key。推荐统一来源是用户级 HITHINK_FINANCE_API_KEY,其次是 hithink-finance/credentials.env 用户级凭据文件。

  • 每次使用 Skill 时先检查统一凭据来源;找到后直接复用,不得因切换接入方式再次索要。
  • 不得强制用户把 Key 粘贴到对话;用户主动提供或选择 Agent 代配时,不得复述,并应安全写入用户级统一凭据来源。
  • 不得把 Key 写入代码、Prompt、日志、公开配置、产物或 Git。
  • CLI 安装、统一凭据新增或更新后,通过 stdin 登录;已有 CLI 凭据用 auth login --api-key-stdin --replace 原子替换。CLI 系统凭据库保留独立副本。
  • REST/Python 读取统一环境变量或用户级凭据文件;旧变量仅兼容。
  • MCP 优先使用 ${HITHINK_FINANCE_API_KEY},不继承环境时由 Agent 从统一来源配置客户端 Secret。

大数据纪律

禁止把全市场、分页全集、多年或多标的原始结果输出到会话上下文。

<command> ... > /tmp/result.json
# 只报告文件路径、行数、时间窗口和摘要

CLI 优先使用具体命令的 --outputdb exportmarket panel --output。Python/marketdb 将结果写到 /tmp/out/ 或用户指定路径。不要回显凭证或完整数据文件。

文档治理

  • 根 README 做项目总览;子目录 README 详细解释当前目录,不把细节继续拆散到不必要的多层文档。

  • 上游 REST API 契约只在 docs/api/ 维护;修改后运行:

    python scripts/sync_skill_contracts.py
    python scripts/sync_skill_contracts.py --check
    

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 89 lines · 1,319 tokens per session scan A 608dcf7fe7b1

Subscribe to this mod's changes

Financial-API AGENTS.md is an instructions file published in the GitHub repository HiThink-Tech/Financial-API (2,118 stars, last pushed 5d ago), licensed MIT. It adds 1,319 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

china-financial-services AGENTS.md

Instructions for cyijun/china-financial-services, covering agents.md, 项目边界, 目录、marketplace 与唯一数据源, 数据、安全与研究证据 and 修改原则.

cyijun/china-financial-services · 1,503 tokens

aurumq-rl CLAUDE.md

Claude Code instructions for yupoet/aurumq-rl, covering claude.md — aurumq-rl ai 协作约定, 项目定位, 输入数据契约(核心约定), 技术红线(不可违反) and 1. 训练资源限制.

yupoet/aurumq-rl · 3,364 tokens

all-weather-portfolio CLAUDE.md

Claude Code instructions for IdealAuror/all-weather-portfolio, covering claude.md, 策略优化闭环, 前置原则, 第 0 层:哲学基座 and sperandeo 三层结构.

IdealAuror/all-weather-portfolio · 3,434 tokens

aurumq-rl AGENTS.md

AGENTS.md instructions for yupoet/aurumq-rl, covering repository guidelines, project structure & module organization, build, test, and development commands, coding style & naming conventions and testing guidelines.

yupoet/aurumq-rl · 636 tokens

china-financial-services CLAUDE.md

Instructions for cyijun/china-financial-services, a project described as: AI agent plugins & managed-agent templates for China A-share market research and financial modeling, powered by Tushare. Research workflows and valuation tools for professional analyst review—not investment advice. | 面向中国 A 股市场的 AI…

cyijun/china-financial-services · 3 tokens

stock-sdk AGENTS.md

Instructions for chengzuopeng/stock-sdk, covering stock sdk 项目规范, 规则验证指令, 项目概述, 版本与分支 and 技术栈.

chengzuopeng/stock-sdk · 10,850 tokens