BT AI development portal

BT AI development portal

BT AI development portal

Function

BT official website provides a set of official knowledge interfaces for general coding AI, intelligent IDE and documentation tools that can be read on demand. It completely covers BT language semantics, syntax, standard library, Web development, bt_app desktop development, network and devices, extensions and FFI, while avoiding putting the complete knowledge base into the model context every time.

When providing a separate URL to the AI, use the following:

This entrance will require the AI to search first, and then read a single function document, a single stable knowledge block, or a module that is really needed. The interface only returns public documents and does not receive user questions, project source code, model configuration, account number, API Key or other private data.

Syntax

Recommended reading order:

1. Read only /ai for the first time;

2. Use /ai/search to query the API name, module name or runtime name;

3. When the search result is symbol, use the complete function contract in the response directly, which is Read markdown_url when doc, read content_url when block;

4. Read the entire module only when the system design or semantics are uncertain;

5. The complete index and offline package are only for client caching, offline development or knowledge tool integration.

Parameters

Path Parameters

FieldTypeRequiredDefault valueValid range or optional valueMeaning
block_nameStringKnowledge block interface isNoneSearch results Stable block name in content_urlSingle knowledge block to read.
pathStringThe exact documentation interface isNoneSearch results Documentation path in markdown_urlFunction or topic to read Markdown.
knowledge_versionStringThe full package interface isNoneknowledge_versionThe immutable offline package version of the manifest to download.

Query Parameters

FieldTypeRequiredDefault valueValid range or optional valueMeaning
limitIntNo81..20; illegal value falls back to 8, which is greater than 20. Press 20The maximum number of search results returned.

Conditional request header

FieldTypeRequiredDefault valueValid range or optional valueMeaning
304 Not Modified.
If-Modified-SinceStringNoNoneLast responded Last-Modified304 Not Modified is returned when If-None-Match is not sent at the same time and the release time is consistent.

Return Value

AI first reading entry

GET /ai returns a condensed plain text with Markdown structure as text/plain; charset=utf-8 to avoid rejection of response by AI crawling components that only accept common web page text types. The main text includes:

- the most token-saving forced reading strategy;

- search, precise documentation, knowledge blocks, modules and offline package addresses;

- module routing, dependency and token estimation;

- shorthand for running, building and accepting BT and bt_app.

It is not a full document, and AI should not guess specific function signatures based only on the entry summary.

Knowledge Manifest

GET /ai/manifest Returns UTF-8 JSON:

FieldTypeRequiredDefault valueValid range or optional valueMeaning
schema_versionIntYesNoneCurrently 1Manifest structure version.
bt_versionStringYesNoneThree-stage versionBT version corresponding to knowledge.
knowledge_versionStringYesNoneYYYY.MM.DD.revisionThe only version released by this official knowledge.
updated_atStringYesNoneISO 8601Knowledge release time.
last_modifiedStringYesNoneRFC 7231 HTTP DateThe last modified time used by the conditional request.
min_client_versionStringYesNoneThree-stage versionThe minimum tool version that can read the current schema.
guide_urlStringYes/aiAbsolute path within the siteThe only standardized entrance for universal AI.
text_content_typeStringYestext/plain; charset=utf-8Fixed valueCompatible response type used by AI portals, precise documentation, knowledge blocks, and modules; the body still uses Markdown structure.
search_url_templateStringYesNoneWith {query} and {limit} placeholdersSmall results search interface template.
search_index_urlStringYes/ai/indexAbsolute path within the siteComplete search index address.
search_index_sha256StringYesNone64-bit lowercase hexFull search index raw UTF-8 byte digest.
block_url_templateStringYesNoneWith {module_id} and {block_name} placeholdersA single knowledge block interface template.
docs_url_templateStringYesNoneWith {path} placeholderExact function or theme Markdown interface template.
source_sha256StringYesNone64-bit lowercase hexadecimalNormalized summary of a single knowledge source.
bundle_formatStringYesbt-ai-bundle-json-v1Fixed valueComplete offline package format.
bundle_urlStringYesNone/ai/bundle/{knowledge_version}The current complete offline package address.
bundle_sha256StringYesNone64-bit lowercase hexadecimalRaw UTF-8 byte digest of the complete offline package.
modulesArray[Object]YesNoneFixed module listKnowledge module metadata that can be read on demand.

modules[] Field:

FieldTypeRequiredDefault valueValid range or optional valueMeaning
idStringYesNoneStable module IDUnique identification of the module.
revisionIntYesNoneGreater than or equal to 1Module text revision number.
content_urlStringYesNone/ai/knowledge/{id}Markdown address of the entire module.
sha256StringYesNone64-bit lowercase hexadecimalThe raw UTF-8 byte digest of the module.
approx_tokensIntYesNoneGreater than 0The approximate number of Tokens of the module.
runtimesArray[String]YesNonecli/web/desktop/extension/ffiModule applicable runtime.
tagsArray[String]YesNoneStable search tagModule topic tag.
depends_onArray[String]Yes[]Other module IDDependencies that should be considered before reading the entire module.
block_countIntYesNoneGreater than 0The number of stable knowledge blocks contained in the module.

Search for

GET /ai/search by keyword Return small UTF-8 JSON:

FieldTypeRequiredDefault valueValid range or optional valueMeaning
queryStringYesNoneQuery text normalized to lowercaseThis actual query.
limitIntYes81..20The upper limit of this result.
countIntYesNone0..limitActual returned quantity.
resultsArray[Object]Yes[]Function contract, document, or knowledge block resultExact symbols and exact paths take precedence, followed by related candidates.

results[] Common fields and branch fields:

FieldTypeRequiredDefault valueValid range or optional valueMeaning
kindStringYesNone
idStringYesNoneStable IDResult identification.
titleStringYesNoneNon-empty textResult title.
approx_tokensIntYesNoneGreater than 0Read the approximate number of Tokens for this result.
signatureStringsymbol YesNoneMarkdown inline codeFunction calling method.
parametersStringsymbol YesNoneTextParameter name, type and required rules.
defaultsStringsymbol YesNoneTextParameter default value.
returnsStringsymbol YesNoneTextReturn type and semantics.
exampleStringsymbol YesNoneMarkdown inline codeMinimal call example.
notesStringsymbol YesNoneTextBehavior boundaries and precautions.
limitsStringsymbol YesNoneTextContext, permissions, or resource restrictions.
categoryStringdoc YesNoneDocument CategoryThe exact category to which the document belongs.
markdown_urlStringdoc YesNone/md/docs/...The exact Markdown address that the AI should read.
html_urlStringdoc YesNone/docs/...Human readable page.
module_idStringblock YesNoneStable module IDThe module to which the knowledge block belongs.
runtimesArray[String]block YesNoneRuntime listKnowledge block applicable runtime.
tagsArray[String]block YesNoneTag listKnowledge block topic tags.
content_urlStringblock YesNone/ai/block/...The address of the single block of Markdown that the AI should read.
sha256Stringblock YesNone64-bit lowercase hexadecimalSingle block text summary.

Full Search Index

GET /ai/index Returns a JSON index of all accurate documents and stable knowledge chunks. It is suitable for IDE or local tools to build caches, but is not suitable for direct use as a model context for ordinary coding tasks.

FieldTypeRequiredDefault valueValid range or optional valueMeaning
schema_versionIntYesNoneCurrently 1Index structure version.
knowledge_versionStringYesNoneCurrent knowledge versionRelease version to which the index belongs.
source_sha256StringYesNone64-bit lowercase hexadecimalSummary of the knowledge source corresponding to the index.
entriesArray[Object]YesNonesymbol/doc/block Mixed ListAll searchable entries; internally search_text and exact_queries are search matches only.

Single knowledge block and the entire module

GET /ai/block/{module_id}/{block_name} returns only a stable Markdown knowledge block; GET /ai/knowledge/{module_id} returns the entire module. Both transfer Markdown body as text/plain; charset=utf-8 and provide SHA-256 and conditional caching response headers.

Knowledge chunks are usually much smaller than the entire module. For example, when you only need the String method summary, you should read the corresponding knowledge block; when you only need the precise signature of string.replace, you should directly use the symbol function contract in the search results.

Complete offline package

GET /ai/bundle/{knowledge_version} Returns bt-ai-bundle-json-v1 JSON:

FieldsTypeRequiredDefaultValid range or optionalMeaning
schema_versionIntYesNoneCurrently 1Full package structure version.
bundle_formatStringYesNonebt-ai-bundle-json-v1Complete package format.
knowledge_versionStringYesNoneConsistent with the requested versionKnowledge version in the package.
manifestObjectYesNoneManifest SnapshotTo avoid self-referential hashes, bundle_sha256 is fixed to null within the package.
block_indexObjectYesNoneschema 1Line number, label, token estimate and summary of all stable knowledge blocks.
modulesObject[String,String]YesNoneKey is module IDAll modules Markdown text.

Response header

FieldTypeRequiredDefault valueValid range or optional valueMeaning
Content-TypeStringYesNoneJSON uses application/json; AI text uses text/plain; charset=utf-8Response body format; plain text body remains Markdown Titles, tables and code blocks.
Cache-ControlStringYesNoneFirst read entry 60 seconds; search/knowledge 5 minutes; version package one year and immutableClient cache strategy; first read entry shortens the cache, so that compatibility adjustments such as content types can take effect quickly.
ETagStringThe versioned interface outside the search interface isNoneHTTP entity tagConditional request value.
Last-ModifiedStringThe versioned interface outside the search interface isNoneRFC 7231 HTTP DateConditional request value.
X-BT-Knowledge-VersionStringAI JSON/text interface isNoneCurrent knowledge versionThe knowledge version to which the response belongs.
X-Content-SHA256StringIndexes, knowledge chunks, modules, and complete packages areNone64-bit lowercase hexadecimalA summary of the current response body.
Access-Control-Allow-OriginStringThe AI interface is*Fixed to *Allow public knowledge clients to read across domains.

Code Examples

The following BT script searches for string.replace, reading the minimal function contract directly:

The following BT script verifies a single knowledge block by manifest:

Notes

- Normal coding tasks do not read the full search index, the full module set, or the offline package; search first and read by minimal results.

  • /llms.txt is an automatically discovered alias agreed by AI tools, and the text format is still Markdown; only https://btlang.org/ai is used when developers actively provide links.
- AI portals, precise documentation, knowledge blocks and modules intentionally use the more compatible text/plain and do not change back to text/markdown which may be rejected by some web page reading components.

- When the API name is known, search for category api_name or the complete symbol first, such as string replace, mysql begin, window.bt.call.

  • The same development task should always use one knowledge_version, and do not mix two versions in the middle of the task.
- Modules, knowledge blocks, indexes or offline packages should be SHA-256 verified against the original UTF-8 bytes after downloading before being written to the official cache.

- The 304 response has no body, the client should continue to use the local verified content.

  • When the official website is inaccessible, the tool can fall back to its own built-in and verified complete package; ordinary projects must not assume the existence of fixed local directories such as E:\bt-lang.
- The project's own AGENTS.md, README, runtime file locations and test commands take precedence over this site's general recommendations.

- Unknown paths, modules or knowledge blocks return 404, missing search terms return 400, non-GET requests return 405.