Financial-API: Instructions file for Codex

AGENTS.md

Financial-API AGENTS.md is an instructions file for Codex, OpenCode from HiThink-Tech/Financial-API. It costs 1,787 tokens per session, scanned A, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is HiThink-Tech/Financial-API's own configuration. It tells Codex and OpenCode how to work on Financial-API itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Financial-API configures →

About the project

HiThink-Tech/Financial-API is an official Tonghuashun service that provides A-share market data, including prices, financial statements, indices, sectors, funds and trading activity through APIs and developer tools. It serves AI agents, quantitative researchers and application developers. The catalogue add-ons help coding agents access and use this financial data.

HiThink-Tech/Financial-API · 4,715 stars · on GitHub · fuyao.aicubes.cn

Reuse

Borrowing it

Nothing to install: this file belongs to HiThink-Tech/Financial-API. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/HiThink-Tech/Financial-API/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/HiThink-Tech/Financial-API

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Financial-API AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hithink-tech/financial-api/agents-md/github.svg)](https://agentmods.dev/instructions/hithink-tech/financial-api/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/hithink-tech/financial-api/agents-md"><img src="https://agentmods.dev/badge/instructions/hithink-tech/financial-api/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Financial-API AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hithink-tech/financial-api/agents-md"><img src="https://agentmods.dev/badge/instructions/hithink-tech/financial-api/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,787 This file is loaded in full into every session.
When invoked 1,787 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01787 $0.01787
Opus 5.5 $0.00715 $0.00715
Sonnet 5.5 $0.00357 $0.00357
Haiku 4.5 $0.00179 $0.00179

Measured 18d ago against content hash 2c3f79b4f423, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 18d 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 · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 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. CLI 业务任务直接读取命中的 CLI 内置领域 Skill,安装前准备读取 CLI 首次接入;REST 文档和接口选路读取 hithink-finance,MCP 配置和工具调用读取 hithink-finance-mcp。
  3. 只加载 Skill 选择的接入入口、业务域首页和目标接口小节或工具文档,不要递归读取全部契约。

Monorepo 边界

  • hithink-finance-cli/:Node.js CLI 子项目,面向人类、Agent 和自动化;运行时不依赖 Python。
  • python/:唯一 Python 项目根,包含远端取数 toolkit、本地 marketdb、示例和测试。
  • docs/:公共文档中心;docs/api/ 按前端单接口页与多接口模块页组织 REST 契约,docs/mcp/ 提供原子工具文档。
  • skills/hithink-finance/:独立的 REST API Wiki 与 API Router;契约从 docs/api/ 镜像,附带 CLI 简介。
  • skills/hithink-finance-mcp/:独立的 MCP 配置、业务域选路与 tool 契约;按业务分类合并工具文档,每个 tool 保留包含参数与返回字段的独立小节。
  • examples/:monorepo 级示例导航与静态灵感。

选择接入方式

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

CLI 业务域优先按内置 Skill 的 description 选择,选定后读取目标 reference,并按需运行 schema <id>;未知命令再查询 capabilities;MCP 以实时 tools/list 为准;REST 响应字段以 docs/api/ 及远端 https://fuyao.aicubes.cn/llms-full.txt 为准;Python 适配层参数以当前函数签名和 --help 为准。

认证凭据

CLI 默认推荐 OAuth,先复用当前有效凭据;同一系统用户、同一服务环境下共享认证状态,可分别保存 OAuth 和 API Key,由 auth use 选择当前方式。首次登录或 OAuth 失效时使用 auth login --method oauth;用户明确选择 API Key 时使用对应流程。OAuth 默认连接生产认证服务。命令和存储边界见 hithink-finance-cli/README.md。

REST/Python/MCP 使用在 https://fuyao.aicubes.cn/admin/ 获取的 API Key,统一来源为用户级 HITHINK_FINANCE_API_KEY,其次是 hithink-finance/credentials.env 用户级凭据文件。

  • 准备 CLI 远端取数时先用只读 auth status 检查已启用凭据,按当前方式调用;OAuth 失效时提示重新认证。仅查询接口文档时直接读取本地契约。
  • REST/Python/MCP 取数或认证诊断复用统一 Key 来源,不得因切换接入方式再次索要。
  • 不得强制用户把 Key 粘贴到对话;用户可以为了便利主动提供给 Agent 上下文。接收后不得复述,应提示聊天平台可能保留消息记录,并安全写入用户级统一凭据来源。
  • 不得把 Key 写入代码、日志、公开配置、产物或 Git。
  • CLI 首次初始化且没有旧 Key 候选时,仅导入一次进程环境 Key;后续通过 auth login --method api-key --api-key-stdin 更新,兼容 --replace。业务命令的显式 --api-key-stdin 只覆盖本次请求。
  • REST/Python 读取统一环境变量或用户级凭据文件;旧变量仅兼容。
  • MCP 优先使用 ${HITHINK_FINANCE_API_KEY},不继承环境时由 Agent 从统一来源配置客户端 Secret。

Read the full file on GitHub · 94 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. 18d ago Changed · +5 lines · +331 tokens per session 2c3f79b4f423
  2. 2mo ago Changed · +46 tokens per session 31ba9e24f1fb
  3. 2mo ago Changed · +91 tokens per session cbae328a4526
  4. 3mo 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 (4,715 stars, last pushed 3d ago), licensed MIT. It adds 1,787 tokens to every session, about $0.0071 per session on Opus 5.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

Financial-API AGENTS.md compared with instructions from other repositories

Financial-API AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Financial-API AGENTS.mdHiThink-Tech/Financial-APIInstructions file4.7k3d agoMITA1,787Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file289k2d agoMITA4,393Codex, OpenCode