{
 "kind": "api",
 "slug": "neon",
 "path": "apis/neon/",
 "name": "Neon",
 "logo": "https://agentgid.com/media/avatars/neondatabase.png",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Databases and backends",
   "apis/backend-db/"
  ]
 ],
 "lead": "A Postgres database that sleeps when idle.",
 "chips": [
  {
   "label": "Databases and backends",
   "path": "apis/backend-db/"
  },
  {
   "label": "Official MCP server"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Connect my app to Neon Postgres: read DATABASE_URL from .env on the server only, use neon() from @neondatabase/serverless with tagged templates for queries, retry on short connection drops, and never send the connection string to the browser."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://neon.com"
  },
  {
   "label": "Pricing",
   "href": "https://neon.com/pricing"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/neondatabase/serverless"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Free every month",
   "status": "yes",
   "sub": "Then pay as you go",
   "quote": null,
   "note": "Free tier: 1 GB storage, 100 CU-hours compute/month per project, 100 projects, 5 GB Object Storage, 1M function invocations. As reported on the official pricing page, checked Oct 9, 2026.",
   "src": "https://neon.com/pricing"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "With conditions",
   "status": "cond",
   "sub": null,
   "quote": "Customer acknowledges and agrees it shall not include in Customer Content any cardholder data as defined under PCI-DSS.",
   "note": "Allowed under the Databricks cloud services agreement; do not store payment card data in it.",
   "src": "https://neon.com/terms-of-service"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var DATABASE_URL (queries); NEON_API_KEY (management API)",
   "quote": "WARNING: Running SQL directly from the browser can have security implications.",
   "note": "Database: a connection string with user and password (DATABASE_URL). Management API: an API key sent as Authorization Bearer.",
   "src": "https://neon.com/docs/serverless/serverless-driver.md"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Official MCP server",
   "status": "yes",
   "sub": "llms.txt · OpenAPI · SDK",
   "quote": "Set up with npx neon@latest mcp or use the config generator. Supports OAuth and API key auth.",
   "note": " Our agent check: 5 of 6 (Nov 13, 2026).",
   "src": "https://neon.com/docs/ai/neon-mcp-server.md"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 9, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Neon does",
   "parts": [
    {
     "t": "prose",
     "text": "Neon gives your site or app a ready Postgres database in the cloud, the kind most web apps use to store users, orders and posts. When nobody uses it, the database pauses after 5 minutes and wakes on the next request, so small projects cost little. The free plan is permanent and needs no card."
    },
    {
     "t": "list",
     "items": [
      "Neon is one of 29 APIs in the Databases and backends category on AgentGid.",
      "It is one of 26 that can be started for free.",
      "It ships an official MCP server, like 7 others here.",
      "Its official SDK is the 6th most downloaded in the category (8.8M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "The database behind your web app",
       "text": "Store users, posts and orders for a site you build with an AI assistant, and query it from server code or serverless functions.",
       "idea": false
      },
      {
       "title": "A separate database for each customer",
       "text": "Give every customer, workspace or AI agent its own isolated database, with no fee per database and idle ones costing no compute.",
       "idea": false
      },
      {
       "title": "Safe copy of real data for testing",
       "text": "Make an instant copy of your database to try a change or a new feature, without touching the live data.",
       "idea": false
      },
      {
       "title": "Side projects that cost little",
       "text": "A site with few visitors only pays while someone uses it, because the database pauses when idle.",
       "idea": false
      },
      {
       "title": "Search by meaning in your own data",
       "text": "Store AI text embeddings next to your normal data and find similar articles or products, using the pgvector extension.",
       "idea": false
      },
      {
       "title": "Retry queries after a short drop",
       "text": "Make your app quietly retry a query when the connection drops for a moment during maintenance.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Neon popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "8.8M",
       "l": "SDK downloads a week",
       "d": null,
       "up": false
      },
      {
       "n": "337",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "556",
       "l": "GitHub stars, neondatabase/serverless"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "1 GB storage, 100 CU-hours compute/month per project, 100 projects, 5 GB Object Storage, 1M function invocations"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "$0.106 per CU-hr (Launch), $0.222 per CU-hr (Scale); $0.35 per GB-month storage; $0.023 per GB-month Object Storage; $0.60 per 1M invocations"
      },
      {
       "l": "Plans",
       "v": "Added automatically: its SDK was in 111 of the public agent repos we sampled when it was added; a hosted MCP server in the official MCP Registry. Prices read from the official pricing page."
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "1 CU-hour of compute (Launch)",
       "$0.106"
      ],
      [
       "1 CU-hour of compute (Scale)",
       "$0.222"
      ],
      [
       "1 GB of storage for a month (paid plans)",
       "$0.35"
      ],
      [
       "A small database that sleeps when idle, per month (Launch, vendor example)",
       "$15"
      ]
     ]
    },
    {
     "t": "more",
     "items": [
      {
       "title": "Price history",
       "items": [
        "A year of the pricing page in the Internet Archive (11 months): the lowest monthly figure went from $1.5 (2025-10) to $15 (2026-11).",
        "2026-03: lowest $/month figure $1.5 → $15; new figures $15/mo, $701/mo; no longer shown $1.5/mo, $5/mo",
        "2026-11: new figures $85/mo"
       ]
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 9, 2026. Prices change: confirm before you buy.",
     "link": "neon.com/pricing",
     "href": "https://neon.com/pricing"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free",
       "v": "100 projects, each with 100 CU-hours of compute a month, 1 GB of storage (20 GB in total) and 5 GB of data transfer",
       "src": "https://neon.com/pricing.md"
      },
      {
       "l": "Free",
       "v": "Out of compute hours or transfer, the database is suspended until next month; over the storage cap, writes are blocked",
       "src": "https://neon.com/pricing.md"
      },
      {
       "l": "Free",
       "v": "Pauses after 5 minutes idle, cannot be turned off; up to 2 CU (8 GB RAM)",
       "src": "https://neon.com/pricing.md"
      },
      {
       "l": "All",
       "v": "Up to 10,000 pooled connections per compute",
       "src": "https://neon.com/pricing.md"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "neon.com/pricing.md",
     "href": "https://neon.com/pricing.md"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "Database: a connection string with user and password (DATABASE_URL). Management API: an API key sent as Authorization Bearer."
      },
      {
       "l": "Environment variable",
       "v": "DATABASE_URL (queries); NEON_API_KEY (management API)",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "No"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign up for Neon, create a project in a region close to your app, and copy the connection string. Put it in .env as DATABASE_URL (kept out of git) and in the hosting platform's environment settings.",
      "For automation (creating branches or projects), create a Neon API key. Read NEON_API_KEY on the server and send it as Authorization Bearer.",
      "Before production, choose Launch or Scale and set spending notifications. No code change; the same connection string keeps working."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "It is a paid cloud database with a permanent free plan. Use is governed by the Databricks cloud services agreement; the JavaScript driver is open source under MIT. Payment card numbers may not be stored in it."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed under the Databricks cloud services agreement; do not store payment card data in it.",
       "quote": "Customer acknowledges and agrees it shall not include in Customer Content any cardholder data as defined under PCI-DSS.",
       "src": "https://neon.com/terms-of-service"
      },
      {
       "l": "redistribute-files",
       "v": "Yes",
       "status": "yes",
       "sub": "The serverless driver is MIT licensed; keep its notice when you ship it.",
       "quote": "\"license\":\"MIT\"",
       "src": "https://registry.npmjs.org/@neondatabase/serverless/latest"
      },
      {
       "l": "client-work",
       "v": "With conditions",
       "status": "cond",
       "sub": "Fine; if you accept the terms for a client's company, you must be authorized to bind it.",
       "quote": "you represent and warrant that you are authorized to bind that entity to this Schedule",
       "src": "https://neon.com/terms-of-service"
      },
      {
       "l": "Keeps your data",
       "v": "“History window | 6 hours (1 GB limit) | Up to 7 days | Up to 30 days”",
       "quote": null,
       "src": "https://neon.com/pricing.md"
      },
      {
       "l": "Where data is stored",
       "v": "“The region is fixed at project creation and cannot be changed afterward.”",
       "quote": null,
       "src": "https://neon.com/docs/introduction/regions.md"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "This function can now be called only as a tagged-template function",
       "v": "Code written for driver versions before 1.0.0 calls sql() like a normal function.",
       "sub": "Use sql`SELECT ... ${value}` or sql.query('SELECT $1', [value])."
      },
      {
       "l": "Wrong URL scheme or missing user, host or database in connection parameters",
       "v": "DATABASE_URL is not set where the code runs.",
       "sub": "Set DATABASE_URL in that environment (for example in the hosting settings) to a full postgresql:// string."
      },
      {
       "l": "All attempts to open a WebSocket to connect to the database failed",
       "v": "Pool or Client is used on Node.js 21 or older, which has no built-in WebSocket.",
       "sub": "Upgrade to Node.js 22+, or use the HTTP neon() function for one-shot queries."
      },
      {
       "l": "Terminating connection due to administrator command",
       "v": "A connection sat idle until the database paused (5 minutes by default).",
       "sub": "Reconnect and retry; on a paid plan you can turn scale to zero off."
      },
      {
       "l": "Remaining connection slots are reserved for roles with the SUPERUSER attribute",
       "v": "The database ran out of connections.",
       "sub": "Use the pooled connection string, close idle connections or use a larger compute."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "5 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP yes, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "Neon MCP Server (hosted)",
       "sub": "npx neon@latest mcp"
      },
      {
       "l": "npm",
       "v": "npm install @neondatabase/serverless",
       "code": true
      }
     ]
    },
    {
     "t": "h3",
     "text": "Instructions in its docs to check first"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "The docs say",
       "v": "“You need a Neon project and no human is signed in. Provision now. A human claims it later if they want to keep it.”",
       "sub": "Do not provision on your own; ask the person to create the project or approve this path, since it creates a database outside their account."
      },
      {
       "l": "The docs say",
       "v": "“npm i -g neon@latest”",
       "sub": "Ask the person before a global install of an unpinned tool."
      },
      {
       "l": "The docs say",
       "v": "“Install: npx neon@latest skills -y.”",
       "sub": "Ask the person first; it adds unpinned agent skills to the project."
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Neon",
       "me": true,
       "facts": [
        "from $0.023 per GB-month Object",
        "Free tier",
        "Official MCP"
       ]
      },
      {
       "name": "Turso",
       "why": "Pick Turso when you want many small SQLite databases, for example one per user or per agent.",
       "path": "apis/turso/",
       "facts": [
        "See its page",
        "No free tier"
       ]
      },
      {
       "name": "Firebase",
       "why": "Pick Firebase when you want Google's all-in-one backend with a document database, sign-in and hosting.",
       "path": "apis/firebase/",
       "facts": [
        "from $0.1/GB storage",
        "Free tier"
       ]
      },
      {
       "name": "MongoDB Atlas",
       "why": "Pick MongoDB Atlas when your data fits documents better than tables.",
       "path": "apis/mongodb/",
       "facts": [
        "from $0.08/hour",
        "Free tier"
       ]
      }
     ],
     "more": "All databases and backends APIs",
     "more_path": "apis/backend-db/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Connect my app to Neon Postgres: read DATABASE_URL from .env on the server only, use neon() from @neondatabase/serverless with tagged templates for queries, retry on short connection drops, and never send the connection string to the browser."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create a Neon project in the console and copy the connection string from the Connect button into .env.",
       "code": "DATABASE_URL=postgresql://[user]:[password]@[neon_hostname]/[dbname]",
       "src": "https://neon.com/docs/serverless/serverless-driver.md"
      },
      {
       "text": "Install the serverless driver (Node.js 19 or later; Node.js 22+ for Pool and Client).",
       "code": "npm install @neondatabase/serverless",
       "src": "https://neon.com/docs/serverless/serverless-driver.md"
      },
      {
       "text": "Query the database from server code.",
       "code": "import { neon } from '@neondatabase/serverless';\nconst sql = neon(process.env.DATABASE_URL);\nconst rows = await sql`SELECT * FROM posts WHERE id = ${postId}`;",
       "src": "https://neon.com/docs/serverless/serverless-driver.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "import { neon, Pool } from '@neondatabase/serverless';\nconst sql = neon(process.env.DATABASE_URL);\nawait sql`CREATE TABLE IF NOT EXISTS posts (id serial PRIMARY KEY, title text NOT NULL)`;\nawait sql`INSERT INTO posts (title) VALUES (${'First post'})`;\nawait sql.transaction([\n  sql`INSERT INTO posts (title) VALUES (${'Second post'})`,\n  sql`INSERT INTO posts (title) VALUES (${'Third post'})`,\n]);\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\nconst { rows } = await pool.query('SELECT * FROM posts ORDER BY id');\nconsole.log(rows);\nawait pool.end();",
       "intro": "Verbatim from the docs with comment lines removed. The project management API is separate (Authorization Bearer NEON_API_KEY)."
      },
      {
       "tab": "Response",
       "code": "[\n  { id: 1, title: 'First post' },\n  { id: 2, title: 'Second post' },\n  { id: 3, title: 'Third post' }\n]"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Calling sql('SELECT ... $1', [id]) as in older examples.",
       "fix": "Use a tagged template sql`... ${id}` or sql.query('... $1', [id]).",
       "why": "Since 1.0.0 the plain call throws an error; templates also guard against SQL injection."
      },
      {
       "dont": "Putting DATABASE_URL in front-end code and querying from the browser.",
       "fix": "Query from server code, or protect data with row-level security before any browser access.",
       "why": "Anyone who sees the connection string can run any SQL the role allows."
      },
      {
       "dont": "Installing @neon/serverless from JSR.",
       "fix": "Install @neondatabase/serverless from npm.",
       "why": "The JSR package stays at 1.0.1 and gets no new releases."
      },
      {
       "dont": "Running prisma migrate dev with the pooled connection string.",
       "fix": "Use the direct (non-pooled) connection string for Prisma Migrate.",
       "why": "Prisma Migrate does not work through PgBouncer and fails with prepared statement errors."
      },
      {
       "dont": "Using Pool or Client on Node.js 21 or older.",
       "fix": "Use Node.js 22+ or the HTTP neon() function.",
       "why": "Older Node.js has no built-in WebSocket."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is the free plan a trial?",
       "a": "No. It is permanent, needs no card, and includes 100 projects with 100 compute hours and 1 GB of storage each.",
       "evidence": {
        "url": "https://neon.com/pricing.md",
        "quote": "The Free plan is permanent (not a trial); no credit card required."
       }
      },
      {
       "q": "Does Neon delete inactive free projects?",
       "a": "No. Idle databases pause after 5 minutes and wake on the next query; the project and data stay.",
       "evidence": {
        "url": "https://neon.com/pricing.md",
        "quote": "Neon doesn't pause Free projects for inactivity, and there's no restore step."
       }
      },
      {
       "q": "How much does a small paid database cost?",
       "a": "Neon's own example puts a small database that sleeps when idle at about $15 a month on the Launch plan.",
       "evidence": {
        "url": "https://neon.com/pricing.md",
        "quote": "Typical spend is about $15/month on Launch for a small database and $701/month on Scale for a production workload"
       }
      },
      {
       "q": "Can I cap my bill?",
       "a": "Yes. Spending emails on paid plans, autoscaling limits per database, and consumption limits that suspend a project at a quota.",
       "evidence": {
        "url": "https://neon.com/pricing.md",
        "quote": "Consumption limits, set per project with the Neon API, suspend compute when a project reaches a compute, storage, or data transfer quota."
       }
      },
      {
       "q": "Does it work with my framework?",
       "a": "Yes, with any language, framework or ORM that supports Postgres.",
       "evidence": {
        "url": "https://neon.com/pricing.md",
        "quote": "Lakebase Postgres on Neon includes autoscaling, instant restore, and scale-to-zero, and works with any language, framework, or ORM that supports Postgres."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "Neon"
  ],
  [
   "Category",
   "Databases and backends"
  ],
  [
   "Price",
   "from $0.023 per GB-month Object"
  ],
  [
   "Official SDK",
   "npm @neondatabase/serverless"
  ],
  [
   "Latest SDK",
   "1.2.0 on npm"
  ],
  [
   "Agent check",
   "5 of 6"
  ],
  [
   "Pricing checked",
   "Oct 9, 2026"
  ]
 ],
 "good": [
  "You need a Neon account. The connection string holds a password, so keep it on the server, not in web page code.",
  "On the free plan, running out of monthly compute or transfer pauses the database until next month; data is not deleted.",
  "The first request after a pause wakes the database, which typically takes a few hundred milliseconds."
 ],
 "checked_line": "Read by AgentGid from 25 official pages, card checked Nov 10, 2026; usage numbers update daily."
}