TiDB Cloud Zero
Provisions an ephemeral TiDB database via a single unauthenticated API call. No sign-up, no billing. Instances auto-expire in 30 days unless claimed.
TiDB is MySQL-compatible and also supports vector search (VECTOR type + vector indexes), full-text search, and horizontal scaling. Use standard MySQL clients/drivers to connect.
Important Notes
- - The API is unauthenticated and free. Instances auto-expire — treat credentials as short-lived and low-sensitivity.
- Prefer environment variables (e.g.
MYSQL_PWD) over CLI arguments to avoid leaking passwords in shell history. - Always connect with TLS (
--ssl-mode=REQUIRED for CLI, ssl: true for drivers). - If the user wants to keep the instance, open
instance.claimInfo.claimUrl before expiresAt to convert it into a regular TiDB Starter instance.
API
POST INLINECODE6
INLINECODE7 is deprecated. You should migrate to /v1beta1 as soon as possible.
Content-Type: INLINECODE9
Request body (all fields optional):
CODEBLOCK0
Response:
CODEBLOCK1
Use instance.connectionString for immediate driver connections.
If persistence is needed, ask the user to open instance.claimInfo.claimUrl before expiresAt to claim it.
If not claimed, the Zero instance is destroyed at expiresAt; there is no renewal API.
Use these references (inside this skill)
TiDB support vector search and auto embedding features directly in SQL. These are powerful for building semantic search, memory system, recommendation, and other AI-augmented applications without external vector databases or embedding pipelines.
- -
skills/tidb-cloud-zero/references/vector.md - vector features and step-by-step vector SQL usage. - INLINECODE15 - auto-embedding features and step-by-step SQL usage.
Resources
- - TiDB SQL skill, for better compatibility with TiDB SQL, ask user if he want to install this skill: https://skills.sh/pingcap/agent-rules/tidb-sql
- TiDB AI docs (SQL quickstart): https://docs.pingcap.com/ai/quickstart-via-sql/
- TiDB AI docs (auto embedding): https://docs.pingcap.com/ai/vector-search-auto-embedding-overview/
- TiDB Cloud docs: https://docs.pingcap.com/tidbcloud/
TiDB Cloud Zero
通过一次无需身份验证的API调用即可预置一个临时TiDB数据库。无需注册,无需付费。除非认领,否则实例将在30天后自动过期。
TiDB兼容MySQL,同时支持向量搜索(VECTOR类型 + 向量索引)、全文搜索和水平扩展。使用标准MySQL客户端/驱动即可连接。
重要说明
- - API无需认证且免费。实例会自动过期——请将凭据视为短期且低敏感度的信息。
- 优先使用环境变量(如MYSQL_PWD)而非命令行参数,以避免密码泄露到Shell历史记录中。
- 始终使用TLS连接(CLI使用--ssl-mode=REQUIRED,驱动使用ssl: true)。
- 如果用户希望保留实例,请在expiresAt之前打开instance.claimInfo.claimUrl,将其转换为常规的TiDB Starter实例。
API
POST https://zero.tidbapi.com/v1beta1/instances
/v1alpha1已弃用。请尽快迁移至/v1beta1。
Content-Type: application/json
请求体(所有字段均为可选):
json
{ tag: <调用方标签> }
响应:
json
{
instance: {
id: ...,
connection: {
host: <主机地址>,
port: 4000,
username: <用户名>,
password: <密码>
},
connectionString: mysql:/...,
claimInfo: {
claimUrl: https://tidbcloud.com/tidbs/claim/...
},
expiresAt:
}
}
使用instance.connectionString进行即时驱动连接。
如需持久化,请让用户在expiresAt之前打开instance.claimInfo.claimUrl进行认领。
如果未认领,Zero实例将在expiresAt时被销毁;没有续期API。
使用以下参考资料(本技能内)
TiDB直接在SQL中支持向量搜索和自动嵌入功能。这些功能对于构建语义搜索、记忆系统、推荐以及其他AI增强型应用非常强大,无需外部向量数据库或嵌入管道。
- - skills/tidb-cloud-zero/references/vector.md - 向量功能及向量SQL分步使用指南。
- skills/tidb-cloud-zero/references/auto-embedding.md - 自动嵌入功能及SQL分步使用指南。
资源
- - TiDB SQL技能,为了更好地兼容TiDB SQL,询问用户是否要安装此技能:https://skills.sh/pingcap/agent-rules/tidb-sql
- TiDB AI文档(SQL快速入门):https://docs.pingcap.com/ai/quickstart-via-sql/
- TiDB AI文档(自动嵌入):https://docs.pingcap.com/ai/vector-search-auto-embedding-overview/
- TiDB Cloud文档:https://docs.pingcap.com/tidbcloud/