neon-api-keys

A set of rules for managing Neon API keys. An API key is a secret string that lets software authenticate with Neon.

In plain words
What is it for?
Automating API-key administration, checking existing keys, creating named keys, and revoking keys when they are no longer needed.
Why use it?
It clarifies how to list, create, and revoke keys, including the requirement for an existing personal key when creating another key through the API.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/neondatabase/ai-rules/neon-api-keys
Clone the repo
git clone --depth 1 https://github.com/neondatabase/ai-rules
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 756 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.00756
Opus 5 $0.00010 $0.00378
Sonnet 5 $0.00004 $0.00151
Haiku 4.5 $0.00002 $0.00076

Measured 3d ago against content hash 92f695136278, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

neon-api-keys scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl "https://console.neon.tech/api/v2/api_keys" \
neon-api-keys.mdc · 97 lines

What it actually says

Overview

This document outlines the rules for managing Neon API keys programmatically. It covers listing existing keys, creating new keys, and revoking keys.

Important note on creating API keys

To create new API keys using the API, you must already possess a valid Personal API Key. The first key must be created from the Neon Console. You can ask the user to create one for you if you do not have one.

List API keys

  • Endpoint: GET /api_keys
  • Authorization: Use a Personal API Key.

Example request:

curl "https://console.neon.tech/api/v2/api_keys" \
  -H "Authorization: Bearer $PERSONAL_API_KEY"

Example response:

[
  {
    "id": 2291506,
    "name": "my-personal-key",
    "created_at": "2025-09-10T09:44:04Z",
    "created_by": {
      "id": "487de658-08ba-4363-b387-86d18b9ad1c8",
      "name": "<USER_NAME>",
      "image": "<USER_IMAGE_URL>"
    },
    "last_used_at": "2025-09-10T09:44:09Z",
    "last_used_from_addr": "49.43.218.132,34.211.200.85"
  }
]

Create an API key

  • Endpoint: POST /api_keys
  • Authorization: Use a Personal API Key.
  • Body: Must include a key_name.

Example request:

curl https://console.neon.tech/api/v2/api_keys \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PERSONAL_API_KEY" \
  -d '{"key_name": "my-new-key"}'

Example response:

{
  "id": 2291515,
  "key": "napi_9tlr13774gizljemrr133j5koy3bmsphj8iu38mh0yjl9q4r1b0jy2wuhhuxouzr",
  "name": "my-new-key",
  "created_at": "2025-09-10T09:47:59Z",
  "created_by": "487de658-08ba-4363-b387-86d18b9ad1c8"
}

Revoke an API key

  • Endpoint: DELETE /api_keys/{key_id}
  • Authorization: Use a Personal API Key.

Example request:

curl -X DELETE \
  'https://console.neon.tech/api/v2/api_keys/2291515' \
  -H "Authorization: Bearer $PERSONAL_API_KEY"

Example response:

{
  "id": 2291515,
  "name": "mynewkey",
  "created_at": "2025-09-10T09:47:59Z",
  "created_by": "487de658-08ba-4363-b387-86d18b9ad1c8",
  "last_used_at": "2025-09-10T09:53:01Z",
  "last_used_from_addr": "2405:201:c01f:7013:d962:2b4f:2740:9750",
  "revoked": true
}
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 97 lines · 21 tokens per session scan A 92f695136278

Subscribe to this mod's changes

neon-api-keys is a cursor rule published in the GitHub repository neondatabase/ai-rules (86 stars, last pushed 3mo ago), licensed MIT. It adds 21 tokens to every session and 756 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.