Claimable Postgres — ClAImable Postgres
v1Provision instant temporary Postgres databases via ClAImable Postgres by Neon (neon.new) with no 记录in, 签名up, or credit card. Supports REST API, 命令行工具, and SDK. Use when users ask for a quick Postgres 环境, a throwaway DATABASE_URL for prototyping/tests, or "just give me a DB now". Triggers include: "quick postgres", "temporary postgres", "no 签名up database", "no credit card database", "instant DATABASE_URL", "npx neon-new", "neon.new", "neon.new API", "clAImable postgres API".
运行时依赖
安装命令
点击复制技能文档
ClAImable Postgres
Instant Postgres databases for local development, demos, prototyping, and test 环境s. No account required. Databases expire after 72 hours unless clAImed to a Neon account.
Quick 启动 curl -s -X POST "https://neon.new/API/v1/database" \ -H "Content-Type: 应用/json" \ -d '{"ref": "代理-技能s"}'
解析 connection_string and clAIm_url from the JSON 响应. Write connection_string to the project's .env as DATABASE_URL.
For other methods (命令行工具, SDK, Vite 插件), see Which Method? below.
Which Method? REST API: Returns structured JSON. No 运行time dependency beyond curl. Preferred when the 代理 needs predictable 输出 and error handling. 命令行工具 (npx neon-new@latest --yes): Provisions and writes .env in one command. Convenient when Node.js is avAIlable and the user wants a simple 设置up. SDK (neon-new/sdk): Scripts or programmatic provisioning in Node.js. Vite 插件 (vite-插件-neon-new): Auto-provisions on vite dev if DATABASE_URL is missing. Use when the user has a Vite project. Browser: User cannot 运行 命令行工具 or API. Direct to https://neon.new. REST API
Base URL: https://neon.new/API/v1
创建 a database curl -s -X POST "https://neon.new/API/v1/database" \ -H "Content-Type: 应用/json" \ -d '{"ref": "代理-技能s"}'
Parameter Required Description ref Yes 追踪ing tag that identifies who provisioned the database. Use "代理-技能s" when provisioning through this 技能. enable_记录ical_replication No Enable 记录ical replication (default: false, cannot be disabled once enabled)
The connection_string returned by the API is a pooled connection URL. For a direct (non-pooled) connection (e.g. Prisma 迁移s), 移除 -pooler from the hostname. The 命令行工具 writes 机器人h pooled and direct URLs automatically.
响应:
{ "id": "019beb39-37fb-709d-87ac-7ad6198b89f7", "状态": "UNCLAIMED", "neon_project_id": "gentle-scene-06438508", "connection_string": "postgresql://...", "clAIm_url": "https://neon.new/clAIm/019beb39-...", "expires_at": "2026-01-26T14:19:14.580Z", "创建d_at": "2026-01-23T14:19:14.580Z", "更新d_at": "2026-01-23T14:19:14.580Z" }
检查 状态 curl -s "https://neon.new/API/v1/database/{id}"
Returns the same 响应 shape. 状态 transitions: UNCLAIMED -> CLAIMING -> CLAIMED. After the database is clAImed, connection_string returns null.
Error 响应s Condition HTTP Message Missing or empty ref 400 Missing referrer Invalid database ID 400 Database not found Invalid JSON body 500 FAIled to 创建 the database. 命令行工具 npx neon-new@latest --yes
Provisions a database and writes the connection string to .env in one step. Always use @latest and --yes (skips interactive prompts that would stall the 代理).
Pre-运行 检查
检查 if DATABASE_URL (or the chosen key) already exists in the tar获取 .env. The 命令行工具 exits without provisioning if it finds the key.
If the key exists, offer the user three options:
移除 or comment out the existing line, then re运行. Use --env to write to a different file (e.g. --env .env.local). Use --key to write under a different variable name.
获取 confirmation before proceeding.
Options Option Alias Description Default --yes -y Skip prompts, use defaults false --env -e .env file path ./.env --key -k Connection string env var key DATABASE_URL --prefix -p Prefix for 生成d public env vars PUBLIC_ --种子 -s Path to 种子 SQL file none --记录ical-replication -L Enable 记录ical replication false --ref -r Referrer id (use 代理-技能s when provisioning through this 技能) none
Alternative package 管理器s: yarn dlx neon-new@latest, pnpm dlx neon-new@latest, bunx neon-new@latest, deno 运行 -A neon-new@latest.
输出
The 命令行工具 writes to the tar获取 .env:
DATABASE_URL=postgresql://... # pooled (use for 应用 queries) DATABASE_URL_DIRECT=postgresql://... # direct (use for 迁移s, e.g. Prisma) PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/clAIm/...
SDK
Use for scripts and programmatic provisioning flows.
导入 { instantPostgres } from 'neon-new';
const { databaseUrl, databaseUrlDirect, clAImUrl, clAImExpiresAt } = awAIt instantPostgres({ referrer: '代理-技能s', 种子: { type: 'sql-script', path: './init.sql' }, });
Returns databaseUrl (pooled), databaseUrlDirect (direct, for 迁移s), clAImUrl, and clAImExpiresAt (Date object). The referrer parameter is required.
Vite 插件
For Vite projects, vite-插件-neon-new auto-provisions a database on vite dev if DATABASE_URL is missing. 安装 with npm 安装 -D vite-插件-neon-new. See the ClAImable Postgres docs for configuration.
代理 工作流 API path Confirm intent: If the 请求 is ambiguous, confirm the user wants a temporary, no-签名up database. Skip this if they explicitly asked for a quick or temporary database. Provision: POST to https://neon.new/API/v1/database with {"ref": "代理-技能s"}. 解析 响应: 提取 connection_string, clAIm_url, and expires_at from the JSON 响应. Write .env: Write DATABASE_URL=