QVeris
Implementation guide 实施指南

How to Add Real-Time Stock Market Data to Codex 如何为 Codex 接入实时股票市场数据

Connect Codex to a read-only market-data source through MCP or a composable CLI—then require every result to carry a symbol, price, currency, market session, source, and timestamp. 通过 MCP 或可组合的 CLI,把 Codex 接入只读行情数据源,并要求每次结果都包含股票代码、价格、币种、交易时段、来源和时间戳。

Short answer: 简要答案: Codex should call a trusted external data tool when the task needs a current quote. Do not treat model knowledge, cached files, or an old terminal result as live market data. 应让 Codex 在回答时调用外部 API 获取最新行情。不要把持续变化的股价写进指令或上传的知识文件。
Architecture showing a Codex request routed securely to live market data and returned as a timestamped quote
The model decides when to request data; your integration validates the request, calls the provider, and returns structured evidence. 模型决定何时请求数据;集成层负责校验、调用数据源,并返回结构化依据。
In this guide本指南内容

From first quote to production-ready workflow从首次行情查询到生产级工作流

Use this guide to choose an integration path, define freshness correctly, implement the tool contract, and validate what Codex says when market conditions are messy.本指南帮助你选择接入方式、正确定义数据新鲜度、实现工具契约,并验证 Codex 在复杂市场状态下给出的回答。

Choose the connection 选择接入方式

Two practical ways to give Codex current quotes 让 Codex 获取最新行情的两种实用方式

The right path depends on where the conversation lives and how much control the workflow needs. 选择取决于对话发生在哪里,以及工作流需要多少控制权。

01 · MCP

Connect a market-data MCP server 连接市场数据 MCP Server

Best when Codex should discover and call structured market capabilities directly. Configure an MCP server, keep credentials outside prompts and repositories, inspect the chosen tool, and allow only the read-only quote operations the task needs. 适合让 Codex 直接发现并调用结构化行情能力。配置 MCP Server,把密钥留在提示词和代码仓库之外,先检查所选工具,并只开放任务所需的只读行情操作。

Read the QVeris MCP server setup 阅读 QVeris MCP Server 配置说明
02 · CLI

Create a narrow market-data CLI 创建专用行情 CLI

Best when a repository needs a testable, versioned adapter. Give Codex one command that validates symbols, calls the provider, emits stable JSON, and returns non-zero exit codes for timeouts, limits, or ambiguous instruments. 适合在代码仓库中维护可测试、可版本化的适配器。为 Codex 提供一条命令:校验股票代码、调用数据源、输出稳定 JSON,并在超时、限流或标的歧义时返回非零退出码。

Open the Codex-specific QVeris setup 打开 QVeris Codex 专用配置指南
Copyable Codex setup可复制的 Codex 配置

Add QVeris MCP, verify it, then discover a quote capability添加 QVeris MCP,完成验证,再发现行情能力

Run the official Codex command below with your own API key. It registers the read-only capability layer in Codex without putting the key in the repository. The Codex CLI and IDE extension store this MCP entry in your local Codex configuration.使用你自己的 API key 运行下面的 Codex 官方配置命令。它会把只读能力层注册到 Codex,同时避免把密钥写进代码仓库。Codex CLI 与 IDE 扩展会把该 MCP 条目保存在本机 Codex 配置中。

codex mcp add qveris --env QVERIS_API_KEY=your-api-key-here -- npx -y @qverisai/mcp
codex mcp list

After QVeris appears as enabled, ask Codex to discover a capability before executing anything. Inspect the selected capability to confirm its provider, input schema, freshness, entitlement, and cost. Only then call it with parameters that match the inspected schema.确认 QVeris 已启用后,先让 Codex 发现能力,不要直接执行。检查所选能力的数据源、输入 schema、新鲜度、授权和成本,再按照检查得到的 schema 发起调用。

qveris discover "real-time stock quote with source and timestamp"
qveris inspect <tool-id>
qveris call <tool-id> --params '<validated-json-from-the-inspected-schema>'

Verification prompt: “Use QVeris to find a read-only current quote capability for AAPL. Inspect it first. Return the exchange, currency, market session, source, delay status, and provider timestamp. Do not place a trade.”验证提示词:“使用 QVeris 查找查询 AAPL 当前行情的只读能力,先检查再调用。返回交易所、币种、交易时段、来源、延迟状态和数据源时间戳,不要执行交易。”

See the complete Codex configuration and troubleshooting steps查看完整 Codex 配置与故障排查步骤

Reference architecture参考架构

Four boundaries keep a live quote trustworthy四道边界让实时行情回答更可信

Adding real-time stock market data to Codex is not a direct model-to-exchange connection. A production design separates language reasoning from deterministic validation, provider access, and evidence formatting.为 Codex 接入实时股票市场数据,并不是让模型直接连接交易所。生产架构需要把语言推理与确定性的参数校验、数据源访问和证据格式化分开。

LAYER 1

Conversation and intent对话与意图

Codex identifies whether the user wants a current quote, a historical comparison, market status, or a broader research task. It should ask for clarification when a symbol, exchange, or time horizon is ambiguous.Codex 判断用户要查询当前行情、历史对比、市场状态,还是更完整的研究任务。若股票代码、交易所或时间范围有歧义,应先追问确认。

LAYER 2

Tool contract and policy工具契约与策略

A narrow schema constrains symbols, exchanges, fields, and permitted operations. This layer rejects malformed input, applies user and workspace policy, and keeps read-only retrieval separate from trading.边界清晰的 schema 约束股票代码、交易所、返回字段和允许操作。本层拒绝异常输入、执行用户与工作区策略,并把只读查询和交易严格分离。

LAYER 3

Market-data adapter市场数据适配层

Server-side code owns credentials, provider selection, entitlement checks, retries, normalization, and caching. If providers use different names for sessions or timestamps, the adapter maps them into one stable response.服务端代码负责凭证、数据源选择、授权检查、重试、标准化和缓存。若不同数据源对交易时段或时间戳使用不同字段,适配层应统一为稳定结构。

LAYER 4

Evidence-aware answer证据化回答

The final response combines the quote with its currency, as-of time, session, delay status, and source. The model may explain the result, but it must not silently replace missing fields or present stale data as current.最终回答把行情与币种、数据时间、交易时段、延迟状态和来源一起呈现。模型可以解释结果,但不能悄悄补齐缺失字段,也不能把旧数据说成当前数据。

The key design rule最重要的设计原则

Let the model decide when a quote is needed; let application code decide whether and how the request is safe to execute. The returned JSON—not model memory—is the source of truth for the price.由模型判断何时需要行情;由应用代码判断请求是否可以执行以及如何执行。价格的事实来源是工具返回的 JSON,而不是模型记忆。

Data contract first 先定义数据契约

“Real time” is not one field “实时”不是一个字段就能说明的

A price without timing context can be confidently wrong. Require enough metadata to explain what the number represents. 缺少时间上下文的价格很容易造成误导。应强制返回足够的元数据,说明这个数字究竟代表什么。

Field 字段 Why it matters 为什么重要 Example shape 示例形式
symbol, exchange Disambiguates tickers across venues. 避免不同交易所出现同名代码时混淆。 NASDAQ:AAPL
price, currency Prevents an unlabeled number from being treated as USD. 防止把没有币种标识的数字默认当成美元。 number + ISO currency
as_of Shows when the provider observed or published the value. 说明数据源观察或发布该值的时间。 ISO 8601 timestamp
session Separates regular, pre-market, after-hours, and closed states. 区分正常交易、盘前、盘后和休市。 regular / pre / post / closed
delay, source Makes licensing and freshness limits visible. 把授权范围和新鲜度限制明确展示出来。 delay seconds + provider
Provider decision数据源决策

Choose the feed by evidence requirements, not brand familiarity按证据要求选择行情源,而不是只看品牌熟悉度

The best stock market API for Codex is the one whose coverage, entitlement, freshness, and response metadata match the questions your users ask. A cheap quote endpoint may be sufficient for casual lookup but unsuitable for alerts, compliance-sensitive research, or redistribution.最适合 Codex 的股票行情 API,应在市场覆盖、授权、新鲜度和响应元数据上匹配用户问题。低成本行情端点可能足够应付普通查询,却未必适合提醒、合规敏感研究或数据再分发。

Criterion评估维度 Questions to verify需要核实的问题 Failure if ignored忽略后的风险
Market coverage市场覆盖 Which exchanges, instruments, countries, and asset classes are included?覆盖哪些交易所、证券类型、国家和资产类别? The same ticker resolves to the wrong venue or no result.同名代码被解析到错误市场,或完全没有结果。
Freshness新鲜度 Is the value real-time, delayed, indicative, snapshot, or previous close for this entitlement?在当前授权下,返回的是实时、延迟、指示性、快照还是前收盘价? Codex labels an old value as a live stock price.Codex 把旧价格误称为实时股价。
Session detail交易时段 Can the API distinguish regular, pre-market, after-hours, halted, and closed?API 能否区分正常交易、盘前、盘后、停牌和休市? A post-market value is compared with a regular-session close without explanation.盘后价格与正常收盘价被直接比较,却没有说明口径。
Licensing数据授权 May values be displayed to end users, cached, logged, or redistributed?数据能否向终端用户展示、缓存、记录或再分发? A technically working integration violates display terms.技术上可用的集成却违反了展示条款。
Operational fit运维适配 What are the rate limits, timeout behavior, status page, and support path?限流、超时行为、状态页和支持渠道分别是什么? Peak traffic becomes unexplained missing or repeated quotes.高峰流量导致行情缺失或重复,却无法定位原因。

Do not copy a universal “real-time” label from a provider homepage. Verify the specific exchange, endpoint, account tier, and intended display use in the provider’s official documentation and agreement.不要直接照搬数据源首页上的“实时”宣传语。应在官方文档和协议中核实具体交易所、端点、账户级别及预期展示用途。

Step by step 分步实施

Build the quote workflow 搭建行情查询工作流

STEP 1

Define the user jobs 定义用户任务

Start with quote lookup, daily change, session status, and a timestamp. Treat charts, news, filings, screening, and trading as separate capabilities with separate permissions. 先支持行情查询、日内涨跌、交易时段状态和时间戳。图表、新闻、公告、选股与交易应作为权限独立的能力处理。

STEP 2

Select a data source 选择数据源

Check exchange coverage, entitlement, delay, redistribution terms, uptime, rate limits, and whether timestamps and session status are returned. “Real-time” must match your plan and market. 核对交易所覆盖、数据授权、延迟、再分发条款、可用性、限流,以及是否返回时间戳和交易状态。“实时”的定义必须与你购买的套餐和市场一致。

STEP 3

Expose one narrow tool 暴露一个边界清晰的工具

Accept a symbol or query plus an optional exchange. Return a stable JSON object. Keep provider keys server-side and never ask the model to assemble secret-bearing URLs. 输入股票代码或查询词,并可选指定交易所;输出稳定的 JSON。数据源密钥只保留在服务端,不要让模型拼接带密钥的 URL。

STEP 4

Add response rules 添加回答规则

Require the answer to state the as-of time, currency, session, and source. If data is stale, missing, or ambiguous, the assistant should say so rather than infer a current price. 要求回答注明数据时间、币种、交易时段与来源。若数据过期、缺失或代码有歧义,助手应明确说明,不得推测当前价格。

STEP 5

Test edge cases 测试边界情况

Test weekends, holidays, halts, pre-market and after-hours, invalid symbols, duplicate ticker names, provider timeouts, rate limits, and split-adjusted historical values. 测试周末、节假日、停牌、盘前盘后、无效代码、重名代码、数据源超时、限流,以及复权历史数据。

STEP 6

Observe and cache 监控并合理缓存

Log request ID, selected capability, provider, latency, status, and data timestamp—without leaking keys. Cache only for a duration compatible with the promised freshness. 记录请求 ID、所选能力、数据源、延迟、状态和数据时间戳,但不要泄露密钥。缓存时长必须符合对用户承诺的新鲜度。

Implementation pattern 实现模式

Keep market access behind your server 让市场数据访问留在服务端

This illustrative tool definition is intentionally provider-neutral. Your application—not the model—owns authentication, symbol normalization, retries, entitlements, and the final provider request. 下面的工具定义是与数据源无关的示例。认证、代码标准化、重试、授权判断和最终的数据源请求,都应由你的应用而不是模型负责。

Do not use quote data as personalized investment advice. 不要把行情数据包装成个性化投资建议。

Separate factual market retrieval from recommendations, trading, suitability assessment, and regulated activities. 应把客观行情查询与推荐、交易、适当性评估及受监管活动明确分开。

{
  "type": "function",
  "name": "get_stock_quote",
  "description": "Return a current market quote with freshness metadata",
  "parameters": {
    "type": "object",
    "properties": {
      "symbol": { "type": "string" },
      "exchange": { "type": "string" }
    },
    "required": ["symbol"],
    "additionalProperties": false
  }
}

// Server returns:
{
  "symbol": "...",
  "price": 0,
  "currency": "...",
  "session": "...",
  "as_of": "...",
  "delay_seconds": 0,
  "source": "..."
}
Answer design回答设计

Make freshness visible in every Codex response让每次 Codex 回答都明确展示数据新鲜度

A good tool call can still produce a misleading answer if the model hides timing and scope. Give the assistant a compact output policy that is easy to test.即使工具调用正确,如果模型隐藏时间和口径,最终回答仍可能误导。应给助手一套简洁、可测试的输出规则。

Recommended answer order推荐回答顺序

  1. Resolved company, symbol, and exchange.已解析的公司、代码和交易所。
  2. Price and currency, without unsupported rounding.价格与币种,不进行无依据的舍入。
  3. As-of timestamp with timezone and market session.带时区的数据时间与交易时段。
  4. Delay or data-status label and provider source.延迟或数据状态标签,以及数据来源。
  5. A concise caveat when the market is closed, halted, or the symbol is ambiguous.休市、停牌或代码有歧义时给出简明提示。

Illustrative response回答示例

Example Company (EXCH:XYZ) is shown at 123.45 USD. The quote is marked regular session and was observed at 14:32:08 America/New_York. Source: Example Provider. Data status: real-time under the configured entitlement.示例公司(EXCH:XYZ)当前显示为 123.45 USD。该行情标记为正常交易时段,数据时间为 14:32:08 America/New_York。来源:示例数据源。数据状态:在当前授权下为实时。

This is a formatting example, not an observed market quote. Production values must come from the tool result.这只是格式示例,不是真实观测行情。生产环境中的数值必须来自工具返回结果。

Instruction pattern for the assistant助手指令模式

“For any request containing current, live, now, today, latest, pre-market, or after-hours price intent, call the quote tool before answering. Never recall a price from conversation history. If the result lacks an as-of timestamp, source, or session status, state that the quote cannot be verified as current.”“凡请求包含当前、实时、现在、今天、最新、盘前或盘后价格意图,回答前必须调用行情工具。不得从对话历史中回忆价格。如果结果缺少数据时间、来源或交易时段状态,应说明无法验证该行情是否为当前数据。”

QVeris path QVeris 路径

Discover before you hard-code a provider 在绑定数据源之前先发现和检查能力

QVeris can help an agent discover market-data capabilities, inspect their inputs and outputs, and call the selected tool through a unified interface. This is useful when one workflow may later expand from quotes to filings, news, indicators, or alerts. QVeris 可帮助 Agent 发现市场数据能力、检查输入输出,并通过统一接口调用选定工具。当工作流可能从行情扩展到公告、新闻、指标或提醒时,这种方式尤其有用。

Use an agent interface 使用 Agent 接口

For code-first workflows, discover and inspect stock capabilities through the QVeris CLI or documentation. 对于代码优先的工作流,可通过 QVeris CLI 或文档发现并检查股票能力。

Read the QVeris CLI guide 阅读 QVeris CLI 指南

Plan for broader research 规划更完整的研究流程

See how a market-data MCP entry point can cover quotes, movers, news, macro signals, and historical data. 了解市场数据 MCP 入口如何覆盖行情、异动、新闻、宏观信号和历史数据。

Read the market data MCP guide 阅读市场数据 MCP 指南
Production checklist 生产检查清单

Validate the answer, not only the API call 不仅要验证 API 调用,还要验证最终回答

  • Resolve ambiguous symbols before requesting a quote. 查询行情前先消除股票代码歧义。
  • Return timezone-aware provider timestamps. 返回包含时区的数据源时间戳。
  • Label delayed, indicative, or after-hours values. 标注延迟、指示性或盘后价格。
  • Set timeouts, bounded retries, and rate-limit handling. 设置超时、有限重试与限流处理。
  • Keep API keys outside prompts and client code. 不要在提示词或客户端代码中保存 API Key。
  • Respect provider display and redistribution terms. 遵守数据源的展示与再分发条款。
  • Show the source and as-of time in the final answer. 在最终回答中展示来源和数据时间。
  • Refuse to invent a price when the tool fails. 工具失败时不得编造价格。
Production controls生产控制

Balance freshness, latency, cost, and safety平衡新鲜度、延迟、成本与安全

A reliable Codex stock-data workflow makes these trade-offs explicit. Optimizing only for the fastest model response can increase quote staleness, provider cost, or operational risk.可靠的 Codex 股票数据工作流必须明确这些取舍。只追求模型最快回答,可能增加行情陈旧、数据成本或运维风险。

Freshness and caching新鲜度与缓存

Set cache policy by user intent and feed rights. A repeated educational lookup may tolerate a short cache; a market alert may require a new request. Return both the provider timestamp and any cache age so the assistant can describe the result honestly.根据用户意图和数据授权设置缓存策略。重复的教学查询可能允许短时缓存,市场提醒则可能必须重新请求。应同时返回数据源时间戳和缓存年龄,让助手如实描述结果。

Latency and fallbacks延迟与降级

Use a bounded timeout and at most a controlled retry for transient failures. If a fallback provider has different coverage or delay, expose that substitution in the response instead of making the sources appear equivalent.设置明确超时,并只对暂时性故障进行有限重试。若备用数据源在覆盖或延迟上不同,应在回答中说明替换,不能让不同来源看起来完全等价。

Cost control成本控制

Prevent one prompt from expanding into hundreds of symbols. Cap list size, separate batch endpoints, deduplicate repeated symbols, and monitor provider calls per conversation. Ask for confirmation before expensive scans.避免一个提示词扩展成数百个股票查询。限制列表规模、为批量查询使用独立端点、去重重复代码,并监控每次对话的数据源调用数。高成本扫描前应要求确认。

Credential security凭证安全

Store market-data keys in a server-side secret manager or managed connection. Scope credentials to read-only data where possible, rotate them, redact request headers from logs, and never return provider secrets to Codex.把市场数据密钥保存在服务端密钥管理器或托管连接中。尽可能使用只读权限,定期轮换,在日志中隐藏请求头,并且绝不能把数据源密钥返回给 Codex。

User and data privacy用户与数据隐私

A quote symbol is often low sensitivity, but watchlists, positions, account identifiers, and strategy prompts may not be. Minimize what is sent to the provider and document what external service receives.单个股票代码通常敏感度较低,但自选列表、持仓、账户标识和策略提示词可能并非如此。应减少发送给数据源的内容,并明确哪些外部服务会接收数据。

Read versus trade查询与交易分离

Keep the quote tool read-only. If trading is ever added, use a separate tool, stronger authentication, explicit confirmation, idempotency, position and risk checks, and a complete audit trail.行情工具应保持只读。如果未来增加交易能力,应使用独立工具、更强认证、明确确认、幂等控制、持仓与风险检查,以及完整审计记录。

Failure modes失败模式

Why a live stock quote workflow gives the wrong answer实时股票行情工作流为什么会答错

Symptom现象 Likely cause可能原因 What to fix修复方法
Codex gives a price without calling the toolCodex 未调用工具就给出价格 Tool description or assistant instructions do not identify freshness intent.工具描述或助手指令没有明确识别实时意图。 Add trigger terms and require a tool call for current-price questions; test paraphrases, not only one prompt.补充触发词,并要求当前价格问题必须调用工具;测试多种表达,而不只是一个提示词。
The quote is correct but labeled “live” incorrectly价格正确,但被错误标成“实时” The adapter discarded provider delay or entitlement metadata.适配层丢弃了数据源延迟或授权信息。 Preserve data status and make the model repeat it; never infer real-time status from a recent timestamp alone.保留数据状态并要求模型复述;不能仅凭时间戳较新就推断为实时。
A symbol returns the wrong company股票代码返回了错误公司 Ticker resolution ignored exchange or country context.代码解析忽略了交易所或国家上下文。 Return candidate matches and ask the user to disambiguate before the quote call.先返回候选结果,在调用行情前让用户确认。
Prices change between two turns with no explanation两轮对话价格变化,却没有解释 One answer came from cache or a different session/feed.其中一次来自缓存,或使用了不同交易时段/数据流。 Display as-of time, cache age, session, and source on every answer.每次回答都显示数据时间、缓存年龄、交易时段与来源。
The assistant retries until rate-limited助手持续重试直至触发限流 The tool loop lacks terminal error states and retry limits.工具循环缺少终止错误状态和重试上限。 Classify errors as retryable or terminal, cap attempts, and return a user-readable failure reason.把错误分为可重试和终止型,限制尝试次数,并返回用户可理解的失败原因。
Validation playbook验证方案

Prove the workflow before users trust it在用户信任之前先证明工作流可靠

A useful evaluation set measures more than whether an API returned HTTP 200. Test tool selection, argument accuracy, evidence preservation, language quality, and safe failure behavior.有效的评测不应只检查 API 是否返回 HTTP 200,还要测试工具选择、参数准确性、证据保留、语言质量和安全失败行为。

PHASE 1 · CONTROLLED CASES阶段 1 · 受控用例

Build a compact evaluation set建立精简评测集

  • Unambiguous U.S. symbol during regular hours正常交易时段的明确美股代码
  • Duplicate ticker across exchanges跨交易所重名代码
  • Weekend, holiday, halt, pre-market, and after-hours周末、节假日、停牌、盘前与盘后
  • Invalid symbol, timeout, rate limit, and empty provider result无效代码、超时、限流与数据源空结果
  • English and Chinese versions of the same intent同一意图的英文与中文表达
PHASE 2 · ACCEPTANCE阶段 2 · 验收

Score the full answer评估完整回答

  • Correct tool selected and no unnecessary calls工具选择正确,没有多余调用
  • Symbol and exchange resolved correctly股票代码与交易所解析正确
  • Price, currency, source, session, and timestamp preserved价格、币种、来源、时段与时间戳完整保留
  • No unsupported claim that data is real-time没有无依据声称数据为实时
  • Failure produces a clear limitation, never an invented quote失败时明确说明限制,绝不编造行情

Release gate上线门槛

Do not publish the integration until every supported market has an explicit freshness definition, every quote includes traceable metadata, and every tested provider failure ends with an honest user-facing response. Re-run the set whenever the provider, schema, tool description, model, or caching policy changes.在每个支持市场都有明确新鲜度定义、每条行情都具备可追踪元数据、每种已测试的数据源故障都能得到诚实的用户回答之前,不应上线。更换数据源、schema、工具描述、模型或缓存策略后,都要重新执行评测。

FAQ

Real-time stock data and Codex questions Codex 实时股票数据常见问题

Does Codex have real-time stock market data by default? Codex 默认就有实时股票行情吗?

Do not assume it does. For a repeatable application, connect a trusted market-data source and retrieve the quote at answer time. Display the source, market session, and timestamp. 不要作此假设。若要构建可重复运行的应用,应连接可信行情数据源,在回答时即时查询,并展示来源、交易时段和时间戳。

Can Codex call a stock market API? Codex 能调用股票行情 API 吗?

Yes. Connect an approved MCP server or give Codex a narrow CLI that calls the provider and returns structured JSON. Keep credentials out of the repository, make the quote path read-only, and test failure behavior before relying on it. 可以。可连接获准使用的 MCP Server,或为 Codex 提供调用数据源并返回结构化 JSON 的专用 CLI。密钥不要写入仓库,行情链路应保持只读,并在正式使用前测试失败行为。

What is the difference between live and delayed stock data? 实时行情和延迟行情有什么区别?

The exact meaning depends on the exchange, feed, and entitlement. A provider may return a current value for one venue but delayed or indicative data for another. Preserve the provider timestamp and delay metadata instead of applying one label globally. 具体含义取决于交易所、数据流和授权。同一数据源可能对某个市场提供实时值,对另一个市场只提供延迟或指示性数据。因此应保留来源时间戳与延迟信息,不能统一笼统标注。

Should Codex be allowed to place trades from the same tool? 是否应让 Codex 通过同一个工具直接交易?

Usually no. Keep read-only market retrieval separate from order entry. Trading requires stronger identity, authorization, confirmations, risk controls, audit trails, and regulatory review. 通常不应。只读行情查询应与下单分离。交易还需要更严格的身份认证、授权、确认、风险控制、审计记录和监管评估。

How should the workflow handle a closed market? 休市时工作流应如何处理?

Return the latest available value with its timestamp and session status, and state whether it is the previous close, an after-hours quote, or another provider-defined value. 返回最新可用值,同时给出时间戳和交易时段状态,并说明它是前收盘价、盘后行情,还是数据源定义的其他数值。

Glossary术语表

Terms that change what “real-time” means会改变“实时”含义的关键术语

As-of time数据时间
The time associated with the observed or published market value. It is different from the time Codex generated its answer.与市场数值被观察或发布相关的时间,不等同于 Codex 生成回答的时间。
Entitlement数据授权
The contractual permission that determines which market feed, freshness level, display use, and redistribution rights an account receives.决定账户可获得哪种市场数据流、新鲜度、展示用途和再分发权利的合同许可。
Market session交易时段
The trading state associated with a value, such as pre-market, regular, after-hours, closed, or halted.与数值相关的交易状态,例如盘前、正常交易、盘后、休市或停牌。
Snapshot versus stream快照与流式数据
A snapshot returns a value when requested; a stream continuously pushes updates. Conversational quote lookup often needs snapshots, while monitoring may need streaming.快照在请求时返回一个值;流式数据持续推送更新。对话式行情查询通常使用快照,持续监控可能需要流式数据。
Tool callingTool calling
The model produces structured arguments for an application-defined function. Application code validates and executes the market-data request.模型为应用定义的函数生成结构化参数,再由应用代码校验并执行市场数据请求。
Stale quote陈旧行情
A valid historical response that is older than the freshness threshold promised for the current task.数据本身有效,但早于当前任务所承诺新鲜度阈值的行情。
Official references官方参考资料

Verify behavior at the source从源头核实产品行为

OpenAI product behavior and market-data entitlements can change. Check the current official documentation before publishing or modifying a production integration.OpenAI 产品行为和市场数据授权都可能变化。发布或修改生产集成前,应核对最新官方文档。

Next step 下一步

Test one timestamped quote before adding more market tools 先跑通一条带时间戳的行情,再扩展更多市场工具

Start with one symbol, verify its source and freshness, and inspect the structured result before adding news, filings, indicators, or alerts. 从一个股票代码开始,核对来源与新鲜度并检查结构化结果,然后再添加新闻、公告、指标或提醒。