Skip to content

Ai bankofai patch 1#39

Merged
Will-Guan merged 5 commits intomainfrom
ai-bankofai-patch-1
Mar 31, 2026
Merged

Ai bankofai patch 1#39
Will-Guan merged 5 commits intomainfrom
ai-bankofai-patch-1

Conversation

@jizhen181-dot
Copy link
Copy Markdown
Collaborator

No description provided.

Add /messages end point
replace gpt-4 -> gpt-5.2
@github-actions
Copy link
Copy Markdown

Code Review Report

Project: Bank of AI — LLM Service API Documentation
PR: mainai-bankofai-patch-1
Review Date: 2026-03-31
Reviewer: AI Code Reviewer (Code Review Skill v1.0.0)


PR Overview

Branch Information

Property Value
From Branch main
To Branch ai-bankofai-patch-1
Commits 5
Files Changed 2
Lines Added +464
Lines Removed -320

Commit History

Hash Message
e03b329 Update API.md
3ad439c Update API.md
5617664 Update API.md
2dbed57 Update API.md
98dbee5 Merge pull request #38 from BofAI/ai-bankofai-patch-1

Review Summary

Verdict

Verdict: Request Changes

Findings at a Glance

Critical Major Minor Suggestion
Count 0 3 4 3

Summary

This PR rewrites both the English and Chinese versions of the Bank of AI LLM Service API documentation (docs/llmservice/api/API.md and i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md). The primary goals appear to be: restructuring the document hierarchy for clarity, adding a new POST /v1/messages Claude-compatible endpoint, introducing x-api-key header authentication alongside Bearer Auth, adding a web_search_options request parameter, expanding error code coverage (502, 503), and moving all schema definitions into a consolidated top-level section.

The structural improvements are substantial and the reformatted tables are meaningfully cleaner. However, there are three major issues that warrant resolution before merge: a breaking base URL domain change from api.bankofai.ioapi.bankofai.com with no migration guidance, a response schema mismatch for the new /v1/messages endpoint (the Claude Messages API has a completely different response structure than the OpenAI Chat Completions format that is referenced), and the removal of meaningful OpenAI-compatibility context from both the English title and the Chinese introductory narrative. Several minor documentation gaps and inconsistencies between the English and Chinese versions were also found.


Change Summary

1. English API Documentation (docs/llmservice/api/API.md)

File Change Type Description
docs/llmservice/api/API.md Modified Full rewrite of structure, auth, endpoints, and schemas

Purpose: Modernise API reference format; add new POST /v1/messages endpoint; add API Key (x-api-key) auth; add web_search_options parameter; update base URL from .io to .com; consolidate schemas into a dedicated section; update model examples to gpt-5.2.

2. Chinese (Simplified) API Documentation

File Change Type Description
i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md Modified Full rewrite to mirror the English restructuring

Purpose: Align the Chinese localisation with the new structure; add the same new endpoint/auth/parameter additions; remove the original OpenAI-compatibility narrative and JSON code examples.


Detailed Findings


Major

[MJ-01] Base URL Changed from .io to .com with No Migration Notice

Property Value
Severity Major
Category Documentation / Compatibility
File docs/llmservice/api/API.md : Line 18 · i18n/zh-Hans/…/API.md : Line 542

Description

The production base URL is silently changed from https://api.bankofai.io to https://api.bankofai.com in both files. Existing users who have api.bankofai.io hardcoded in their SDKs, configuration files, or environment variables will experience failures if (when) the .io domain is decommissioned. There is no deprecation notice, no migration guide, no note about the old domain, and no timeline. This is effectively an undocumented breaking change published as a silent doc update.

Code

-### BaseURL
-https://api.bankofai.io/
+## Servers
+| URL | Description |
+|-----|-------------|
+| `https://api.bankofai.com` | Production |

Recommendation

Add a prominent migration notice, for example:

> **⚠️ Base URL Change:** The production endpoint has moved from
> `https://api.bankofai.io` to `https://api.bankofai.com`.
> The legacy `.io` domain will be supported until **YYYY-MM-DD**.
> Please update your `baseURL` / `OPENAI_BASE_URL` before that date.

Also add the same notice to the Chinese version.


[MJ-02] POST /v1/messages Response Schema Mismatch (Claude vs. OpenAI Format)

Property Value
Severity Major
Category Correctness / Documentation
File docs/llmservice/api/API.md : Lines 113–117

Description

The new POST /v1/messages endpoint is described as "Claude compatible" and authenticates via x-api-key, which mirrors the Anthropic Messages API. However, its 200 response is documented as ChatCompletionsResponse — the OpenAI-format schema. The real Anthropic Messages API returns an entirely different structure: content is an array of typed content blocks (not a flat string), the completion reason field is stop_reason (not finish_reason), the role/message is in a top-level role/content pair (not nested under choices[]), and it uses input_tokens/output_tokens (not prompt_tokens/completion_tokens).

If the gateway actually converts to the native Claude format, the schema documentation is wrong and will mislead developers. If the gateway returns OpenAI-format responses even on /v1/messages, that must be stated explicitly so Claude SDK users know to adapt their parsing.

Code

**200 Response Content Types:**
- `application/json`: [ChatCompletionsResponse](#chatcompletionsresponse)
- `text/event-stream`: [ChatCompletionsResponse](#chatcompletionsresponse)

Recommendation

Clarify which response structure /v1/messages actually returns:

  • Option A — If the gateway returns the native Anthropic Messages format, create a new MessagesResponse schema documenting the Anthropic structure (top-level id, type, role, content[], model, stop_reason, usage.input_tokens, usage.output_tokens).
  • Option B — If the gateway normalises to the OpenAI format regardless of endpoint, add an explicit note:
    > **Note:** Although this endpoint path mirrors the Anthropic Messages API,
    > the response is returned in OpenAI Chat Completions format.
    > Claude SDK users must use an OpenAI-compatible client library.

[MJ-03] Removal of OpenAI-Compatibility Context Reduces Discoverability and Developer Clarity

Property Value
Severity Major
Category Documentation
File docs/llmservice/api/API.md : Line 6 · i18n/zh-Hans/…/API.md : Lines 527–536

Description

The English title was changed from # AI API (OpenAI Compatible) to # AI API, removing the key compatibility signal. More impactfully, the Chinese version entirely deleted its introductory paragraph that explicitly stated:
本接口与 **OpenAI API 完全兼容**,你可以直接复用现有 OpenAI SDK,仅需替换 Base URL 即可接入。

This context is the single most important piece of information for the primary audience (developers migrating from OpenAI). Its removal forces readers to infer compatibility from endpoint names alone. The new document now opens without any statement of what the service is or what SDK compatibility it offers.

Code

-# Bank of AI LLM API(兼容 OpenAI)
+# AI API
-本接口与 **OpenAI API 完全兼容**,你可以直接复用现有 OpenAI SDK,仅需替换 Base URL 即可接入。

Recommendation

Restore the compatibility statement, either in the title or in a short introductory paragraph for both language versions. For example:

# AI API

This API is **OpenAI-compatible**. You can use any existing OpenAI SDK by
replacing the base URL with `https://api.bankofai.com`. A Claude-compatible
endpoint (`/v1/messages`) is also available via `x-api-key` authentication.

Minor

[MN-01] GET /v1/models Does Not Document x-api-key Auth Support

Property Value
Severity Minor
Category Documentation
File docs/llmservice/api/API.md : Line 55 · i18n/zh-Hans/…/API.md : Line 584

Description

POST /v1/chat/completions documents Bearer Auth; POST /v1/messages documents x-api-key. But GET /v1/models only lists Bearer Auth. It is not stated whether this endpoint also accepts x-api-key. Given that the service now supports two auth schemes, users authenticated exclusively via API key will not know whether they can call the model list endpoint.

Recommendation

Clarify whether GET /v1/models accepts both auth methods:

**Authentication:** Bearer Auth or API Key Auth (`x-api-key`)

Or explicitly state it only accepts Bearer, so API-key-only clients know to handle the 401.


[MN-02] Chinese Version Loses Concrete JSON Code Examples

Property Value
Severity Minor
Category Documentation / Developer Experience
File i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md : Lines 856–891 (deleted)

Description

The original Chinese documentation included hands-on JSON examples for tool calling: a request-side tool definition and the model's response with populated tool_calls. These concrete examples were removed in favour of abstract schema tables. For Chinese-language developers — many of whom rely heavily on copy-pasteable examples — this is a significant reduction in usability. The English version never had these examples (it relied on schema tables), so this is now an inconsistency that disadvantages Chinese readers.

Recommendation

Re-add practical JSON examples for tool calling to the Chinese version, ideally in a ## 使用示例 (Usage Examples) section:

### 工具调用请求示例

```json
{
  "model": "gpt-5.2",
  "messages": [{"role": "user", "content": "北京今天天气如何?"}],
  "tools": [{
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "获取指定城市的天气",
      "parameters": { "type": "object", "properties": { "city": { "type": "string" } } }
    }
  }]
}

[MN-03] web_search_options Schema Incomplete in Chinese Version

Property Value
Severity Minor
Category Documentation
File i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md : Lines 791–797

Description

The English WebSearchOptions schema documents: (1) search_context_size with its enum values ("low", "medium", "high"), (2) user_location with a description noting ISO 3166-1 alpha-2 country codes, city, region, timezone, and (3) a note about model allowlists. The Chinese version only has a two-row table with abbreviated descriptions and no mention of model allowlists or the structured fields of user_location.

Recommendation

Align the Chinese WebSearchOptions schema with the English version:

| 字段 | 类型 | 描述 | 示例 |
|------|------|------|------|
| `search_context_size` | string | 搜索结果占用上下文窗口的量。枚举:`"low"`, `"medium"`, `"high"`| `"medium"` |
| `user_location` | object | 用户近似位置,用于优化搜索结果(国家 ISO 3166-1 alpha-2、城市、地区、时区)。 | |

注意: 此字段仅对支持 Web 搜索的模型生效,部分模型可能不支持。


[MN-04] Model ID Example Changed to a Non-Existent Model (gpt-5.2)

Property Value
Severity Minor
Category Documentation / Accuracy
File docs/llmservice/api/API.md : Lines 200, 215, 430

Description

Multiple schema examples were updated from gpt-4 to gpt-5.2. As of this review date, gpt-5.2 does not correspond to any publicly known OpenAI model name (OpenAI's convention uses gpt-4o, gpt-4-turbo, o3, etc.). Additionally, the owned_by field still says "openai" — if gpt-5.2 is a Bank of AI internal model name, owned_by should reflect the actual owner. Using a fictional future version number as the canonical example model creates confusion for developers trying to match examples against available models.

Recommendation

Use either a real, currently available model ID (e.g. gpt-4o, claude-3-5-sonnet-20241022) or a clearly fictional placeholder (e.g. your-model-id). Update owned_by to match. For example:

| `id` | string | `"gpt-4o"` | |
| `owned_by` | string | `"openai"` | |

Suggestions

[S-01] Add a POST /v1/messages Request Body Example in English Documentation

File: docs/llmservice/api/API.md
Description: The new /v1/messages Claude-compatible endpoint has no usage example. Developers unfamiliar with the Anthropic Messages API format will not know how the x-api-key header is passed, or how to structure requests to this endpoint.
Suggestion: Add a minimal curl or JSON example:

curl https://api.bankofai.com/v1/messages \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-3-5-sonnet", "messages": [{"role": "user", "content": "Hello"}]}'

[S-02] Clarify Whether /v1/messages Accepts the Full Anthropic Request Schema

File: docs/llmservice/api/API.md : Line 98
Description: The POST /v1/messages endpoint references ChatCompletionsRequest as its request body schema. The Anthropic Messages API uses system as a top-level string (not inside messages[]), uses max_tokens as required (not optional), and has additional fields like anthropic_version. If the gateway accepts the Anthropic request format natively, documenting it as ChatCompletionsRequest is inaccurate.
Suggestion: Either confirm the endpoint accepts the standard OpenAI ChatCompletionsRequest body and note this, or create a separate MessagesRequest schema that documents the Anthropic-specific fields (system, anthropic_version, required max_tokens, etc.).


[S-03] Add a Changelog / Migration Notes Section

File: Both API.md files
Description: This PR contains multiple changes that will affect existing users: new base URL domain, new auth method, new endpoint, new request parameter. None of these additions are highlighted as new.
Suggestion: Add a ## What's New or ## Changelog section (or link to a CHANGELOG file) so returning users can quickly identify what changed:

## What's New

| Version | Change |
|---------|--------|
| 1.1 | Added `POST /v1/messages` (Claude-compatible endpoint) |
| 1.1 | Added `x-api-key` header authentication |
| 1.1 | Added `web_search_options` request parameter |
| 1.1 | Base URL updated to `https://api.bankofai.com` (was `.io`) |

Positive Observations

Area Observation
Structure Consolidating all schemas into a dedicated top-level ## Schemas section significantly improves navigability and reduces redundancy.
Table Formatting The new column naming (Field, Type, Description, Example) is consistent throughout and more readable than the old Name/Required columns.
Error Coverage Expanding HTTP error codes to include 502 Bad Gateway and 503 Service Unavailable gives developers a more complete picture of failure modes to handle.
Auth Documentation The new ## Authentication section clearly separates Bearer and API Key auth with their respective header names and formats.
Bilingual Consistency Both the English and Chinese documents are kept in structural sync, which is good for maintainability.
web_search_options Adding WebSearchOptions with enum documentation for search_context_size and user_location is a thoughtful addition that exposes important gateway capabilities.

Checklist Results

Category Items Checked Pass Fail N/A Notes
Correctness 4 2 2 2 Response schema mismatch for /v1/messages; domain change undocumented
Security 3 3 0 5 No credentials exposed; auth types clearly separated
Performance 8 0 0 8 N/A — documentation only
Code Quality 6 5 1 1 gpt-5.2 is a potentially confusing example model name
Testing 5 0 0 5 N/A — documentation only
Documentation 6 3 3 0 Missing migration notice; schema mismatch undocumented; zh-Hans loses context
Compatibility 5 2 2 1 Domain change is breaking; /v1/messages format unverified
Observability 4 0 0 4 N/A — documentation only

Disclaimer

This is an automated code review. It supplements but does not replace human review. The reviewer analysed only the diff between the specified branches. Runtime behaviour, integration testing, and deployment impact are not covered. In particular, the assessment of whether POST /v1/messages returns an OpenAI- or Anthropic-format response is based solely on the documented schema reference; the actual gateway implementation was not inspected.


Report generated by Code Review Skill v1.0.0
Date: 2026-03-31

@github-actions
Copy link
Copy Markdown

Code Review Report

Project: Bank of AI Docs (@x402-tron/docs)
PR: mainai-bankofai-patch-1
Review Date: 2026-03-31
Reviewer: AI Code Reviewer (Code Review Skill v1.0.0)


PR Overview

Branch Information

Property Value
From Branch main
To Branch ai-bankofai-patch-1
Commits 6 (5 content commits + 1 merge commit)
Files Changed 3
Lines Added +465
Lines Removed -321

Commit History

Hash Message
1594cb7 update version
e03b329 Update API.md
3ad439c Update API.md
5617664 Update API.md
2dbed57 Update API.md
3829c99 Merge branch 'main' into ai-bankofai-patch-1

Review Summary

Verdict

Verdict: Request Changes

Findings at a Glance

Critical Major Minor Suggestion
Count 0 3 4 3

Summary

This PR rewrites and restructures the BankofAI LLM API documentation (both English and Chinese/zh-Hans) and bumps the package version from 1.2.5 to 1.2.6. The rewrite improves formatting, adopts a consistent schema-table style, adds a new POST /v1/messages (Claude-compatible) endpoint, introduces API Key Auth (x-api-key) as a second auth method, and documents new features (WebSearchOptions, 502/503 error codes, extended ChatUsage sub-fields).

The documentation quality overall is improved — the new structure is cleaner and more consistent. However, there are three major issues that could mislead or break existing integrations: (1) the base domain silently changed from bankofai.io to bankofai.com with no migration notice, (2) the "OpenAI Compatible" branding was removed in ways that reduce SEO and discoverability, and (3) the Chinese docs lost concrete JSON code examples and an entire summary section that guided users through onboarding. Several minor inconsistencies between the English and Chinese docs also need attention.


Change Summary

1. English API Documentation (docs/llmservice/api/API.md)

File Change Type Description
docs/llmservice/api/API.md Modified Full structural rewrite of the API reference document

Purpose: Restructures the English API docs from a flat, manually-formatted layout to a consistent schema-driven reference style. Adds the new POST /v1/messages (Claude-compatible) endpoint, API Key Auth method, WebSearchOptions schema, expanded ChatUsage sub-fields, 502/503 error codes, and updates model example IDs from gpt-4gpt-5.2.


2. Chinese API Documentation (i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md)

File Change Type Description
i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md Modified Full structural rewrite of the Chinese API reference document

Purpose: Mirrors the English doc restructuring for the Chinese audience. However, this rewrite also removes previously existing JSON code examples and an onboarding summary section.


3. Package Version Bump (package.json)

File Change Type Description
package.json Modified Version incremented from 1.2.51.2.6

Purpose: Semantic version bump to reflect the documentation update.


Detailed Findings


Major

[MJ-01] Silent Base URL Domain Change Without Migration Notice

Property Value
Severity Major
Category Documentation / Correctness
File docs/llmservice/api/API.md : Lines 16–18 and i18n/zh-Hans/…/API.md : Lines 540–542

Description

The API base URL was changed from https://api.bankofai.io/ to https://api.bankofai.com with no deprecation notice, migration guide, or callout to existing users. Anyone currently integrated against api.bankofai.io reading the old docs — or relying on cached versions — will receive no warning that the domain has changed. This is a potentially breaking change for existing integrations.

Code (English doc):

-### BaseURL
-https://api.bankofai.io/
+| URL | Description |
+|-----|-------------|
+| `https://api.bankofai.com` | Production |

Code (Chinese doc):

-- **Host:** api.bankofai.io
+| `https://api.bankofai.com` | 生产环境 |

Recommendation:

Add a migration/deprecation callout near the Servers table in both docs, e.g.:

> **⚠️ Domain Update:** The API base URL has moved from `https://api.bankofai.io` to
> `https://api.bankofai.com`. Please update your integrations. The old domain
> (`api.bankofai.io`) will continue to work until [deprecation date].

[MJ-02] Removal of "OpenAI Compatible" Title Branding

Property Value
Severity Major
Category Documentation
File docs/llmservice/api/API.md : Line 6–7 and i18n/zh-Hans/…/API.md : Line 527–528

Description

The H1 title was changed from # AI API (OpenAI Compatible) to # AI API, and the Chinese title was changed from # Bank of AI LLM API(兼容 OpenAI) to # AI API. The explicit "OpenAI Compatible" label is a key discoverability and trust signal for developers evaluating whether they can drop in this API as a replacement for OpenAI. Removing it from the page title (the most prominent, indexed element) reduces SEO value and forces readers to scan deeper into the document to confirm compatibility. The intro sentence still states compatibility, but the H1 is the anchor for search indexing and first impressions.

Code:

-# AI API (OpenAI Compatible)
+# AI API

-# Bank of AI LLM API(兼容 OpenAI)
+# AI API

Recommendation:

Retain the compatibility signal in the title or add a prominent badge/callout immediately after the H1:

# AI API

> **OpenAI API Compatible** — Drop-in replacement. Use your existing OpenAI SDK;
> just replace the base URL.

[MJ-03] Chinese Docs Lost Concrete JSON Examples and Onboarding Summary

Property Value
Severity Major
Category Documentation
File i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md : Lines 851–924 (removed)

Description

The Chinese documentation rewrite removed: (a) the Function Calling JSON examples (tool definition and model response body samples), (b) the "总结" (Summary) section that included the explicit migration instruction ("只需将 Base URL 替换为 https://api.bankofai.io/v1") and listed supported capabilities, and (c) inline code blocks showing the Authorization: Bearer sk-xxxx header format. These are high-value, concise reference items for Chinese-language developers new to the API. The English doc did not lose equivalent content — making the Chinese localization objectively less helpful post-PR.

Code (removed from zh-Hans):

-# 总结
-
-- 完全兼容 OpenAI API
-- 支持流式输出
-- 支持工具调用(Function Calling)
-- 支持多模型统一接入
-
-只需将 Base URL 替换为:
-
-```
-https://api.bankofai.io/v1
-```
-
-即可快速接入 Bank of AI 🚀

Also removed (Function Calling JSON examples):

-### 工具定义
-
-```json
-{
-  "type": "function",
-  "function": {
-    "name": "get_weather",
-    "description": "获取天气",
-    "parameters": {}
-  }
-}
-```
-
-### 模型调用返回
-
-```json
-{
-  "tool_calls": [
-    {
-      "id": "call_xxx",
-      "type": "function",
-      "function": {
-        "name": "get_weather",
-        "arguments": "{ \"city\": \"Beijing\" }"
-      }
-    }
-  ]
-}
-```

Recommendation:

Re-add the Summary section (updated with the new bankofai.com domain) and the Function Calling JSON examples to the Chinese docs. These should be updated — not deleted — as part of the doc rewrite.


Minor

[MN-01] "Required" Column Dropped from Schema Tables

Property Value
Severity Minor
Category Documentation
File docs/llmservice/api/API.md : Multiple schema sections

Description

The old schema tables included a "Required" column that explicitly flagged which fields were mandatory. The new tables remove this column for most schemas (e.g., ChatMessage, ChatResponseFormat, ChatTool, ChatToolFunction, ChatToolCallItem, ChatToolCallFunction, ChatCompletionsResponse, etc.). Although ChatCompletionsRequest and ToolChoiceObject gained a **Required fields:** note above the table, all other schemas silently lost the required/optional distinction. Developers integrating the API need this information to avoid malformed requests.

Recommendation:

Either restore a Required column to every schema table, or add a consistent **Required fields:** field1, field2 line above each table where applicable (mirroring the style used for ChatCompletionsRequest).


[MN-02] Inconsistent ChatCompletionsResponse Between English and Chinese Docs

Property Value
Severity Minor
Category Documentation
File i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md

Description

The English ChatCompletionsResponse schema table includes the fields service_tier, system_fingerprint, and obfuscation. The Chinese version omits all three. Similarly, the English docs include full sub-schemas for ChatChoice, ChatChoiceDelta, and ChatMessageContent, while the Chinese docs lack these entirely. This creates an inconsistent developer experience across languages and may cause confusion for bilingual or Chinese-only readers.

Recommendation:

Sync the Chinese ChatCompletionsResponse and sub-schema sections to match the English docs, adding service_tier, system_fingerprint, obfuscation, ChatChoice, ChatChoiceDelta, and ChatMessageContent sections.


[MN-03] Model Example ID Updated in English Only (gpt-4gpt-5.2)

Property Value
Severity Minor
Category Documentation
File docs/llmservice/api/API.md vs i18n/zh-Hans/…/API.md

Description

The English docs updated model example IDs from gpt-4 to gpt-5.2 in both V1ModelItem and the ChatCompletionsRequest description. The Chinese docs updated V1ModelItem to gpt-5.2 but the ChatCompletionsRequest table row for model lost its example value entirely (was gpt-4, now blank). This creates a minor inconsistency and a missed opportunity to show the current recommended model ID.

Code (Chinese ChatCompletionsRequest):

-| model | string | 模型 ID,例如 `gpt-4` |
+| model | string | 模型 ID |

Recommendation:

Add the example value back to the Chinese ChatCompletionsRequest table:

| model | string | 模型 ID,例如 `gpt-5.2` |

[MN-04] POST /v1/messages Response Body Schema Not Referenced in Chinese Docs

Property Value
Severity Minor
Category Documentation
File i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/api/API.md : Lines 659–663

Description

In the English docs, the POST /v1/messages endpoint explicitly lists both application/json and text/event-stream response content types with a link to ChatCompletionsResponse. The Chinese equivalent section states application/json and text/event-stream without linking to the response schema, leaving Chinese readers without a schema reference for the new endpoint.

Recommendation:

Add the schema reference to the Chinese POST /v1/messages 200 response section:

**200 返回结构:** [ChatCompletionsResponse](#chatcompletionsresponse)

Suggestions

[S-01] Consider Adding a Quick-Start Code Example in English Docs

File: docs/llmservice/api/API.md
Description: The English docs removed the inline curl/code examples that were previously in the Chinese docs and never had equivalent English examples. A short curl or SDK snippet in the English docs would dramatically improve the onboarding experience, especially given the new dual-auth model (Bearer token vs. x-api-key).
Suggestion: Add a collapsible quick-start section with a curl example for both POST /v1/chat/completions (Bearer) and POST /v1/messages (x-api-key).


[S-02] Clarify Stream vs. Non-stream Response Schema

File: docs/llmservice/api/API.md and i18n/zh-Hans/…/API.md
Description: Both docs now use a single ChatCompletionsResponse schema for both stream and non-stream responses, noting differences in prose. Given that the streaming and non-streaming shapes are meaningfully different (choices[].message vs. choices[].delta), separate schema tables or a clear annotation would help.
Suggestion: Split the schema into ChatCompletionsResponse (non-stream) and ChatCompletionChunk (stream), or add a more prominent inline note per field indicating whether it applies to stream, non-stream, or both.


[S-03] Version Bump Should Reference the Changelog

File: package.json
Description: The version was bumped to 1.2.6 but there is no corresponding CHANGELOG or release notes entry visible in this PR. For a documentation site, a changelog entry helps track what changed between published versions.
Suggestion: Add a CHANGELOG.md entry or GitHub release note summarising the API doc changes in this PR.


Positive Observations

Area Observation
Structure & Consistency The new schema table format is significantly more consistent across all schemas — every table now uses the same Field / Type / Description / Example column layout, making it easier to scan.
New Endpoint Documentation POST /v1/messages (Claude-compatible) is fully documented with its own auth method, request body, response codes, and content types — good completeness for a new endpoint.
Expanded Error Coverage Adding 502 Bad Gateway and 503 Service Unavailable to response code tables gives developers a more realistic picture of failure modes in a proxy/gateway service.
WebSearchOptions Schema The new WebSearchOptions schema is well-documented with field-level descriptions, enums, and notes on which endpoints support the feature.
ChatUsage Sub-fields Expanding prompt_tokens_details and completion_tokens_details into explicit sub-field rows (rather than inline JSON types) greatly improves readability.
Authentication Section Elevating both auth methods to their own top-level Authentication section (with type, format, and header name) is a clear improvement over the previous single-paragraph treatment.

Checklist Results

Category Items Checked Pass Fail N/A Notes
Correctness 4 2 2 2 Base URL change undocumented; missing Required field indicators
Security 3 3 0 5 No secrets/credentials exposed; auth changes are additive only
Performance 0 0 0 8 N/A — documentation-only PR
Code Quality 5 4 1 2 EN/ZH schema inconsistency; otherwise clean formatting
Testing 0 0 0 7 N/A — documentation-only PR
Documentation 7 4 3 0 Missing migration note, removed ZH examples, EN/ZH parity gaps
Compatibility 3 1 2 3 Breaking URL change; backward compat not addressed
Observability 0 0 0 8 N/A — documentation-only PR

Disclaimer

This is an automated code review. It supplements but does not replace human review. The reviewer analyzed only the diff between main and ai-bankofai-patch-1. Runtime behavior, integration testing, and deployment impact are not covered. All findings pertain exclusively to documentation correctness and completeness — no application source code was changed in this PR.


Report generated by Code Review Skill v1.0.0
Date: 2026-03-31

@Will-Guan Will-Guan merged commit 781a1f4 into main Mar 31, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 31, 2026
@github-actions github-actions Bot mentioned this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants