{"openapi":"3.1.0","info":{"title":"Neon Consumption (BYOK) API","version":"0.1.0","description":"Neon Consumption (BYOK) lets an AI assistant read your own Neon Consumption data through the Neon Consumption API with a key you supply (API key). Read-only: 5 tools (get_project_consumption, get_branch_consumption, get_legacy_project_consumption, get_organization_spending_limit, count_project_branches). The BYOK key travels with each request, is used for that one call only and is never stored,...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-neon-consumption.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-neon-consumption/docs"},"termsOfService":"https://connectorbay.com/byok-neon-consumption/terms"},"servers":[{"url":"https://byok-neon-consumption.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-neon-consumption/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_project_consumption":{"post":{"operationId":"get_project_consumption","summary":"Report consumption metrics per project for an organization over a time range (Launch, Scale, Agent, Business and Enterpr","description":"Report consumption metrics per project for an organization over a time range (Launch, Scale, Agent, Business and Enterprise plans). Each project has periods (billing intervals with plan and dates) holding timeframes with metric values. Reads do not wake compute. Use for \"How many compute unit seconds did my Neon projects use this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"org_id":{"description":"Organization id (from the organization list) whose projects are reported.","maxLength":100,"title":"Org Id","type":"string"},"from_time":{"description":"Start of the period as an ISO 8601 date-time, for example 2026-10-01T00:00:00Z (rounded to the granularity; earliest 2024-03-01).","maxLength":40,"title":"From Time","type":"string"},"to_time":{"description":"End of the period as an ISO 8601 date-time, for example 2026-10-15T00:00:00Z.","maxLength":40,"title":"To Time","type":"string"},"granularity":{"description":"Bucket size: hourly (last 168 hours), daily (last 60 days) or monthly (last year).","enum":["hourly","daily","monthly"],"title":"Granularity","type":"string"},"metrics":{"description":"Comma-separated metrics: compute_unit_seconds, root_branch_bytes_month, child_branch_bytes_month, instant_restore_bytes_month, public_network_transfer_bytes, private_network_transfer_bytes, extra_branches_month, snapshot_storage_bytes_month.","maxLength":300,"title":"Metrics","type":"string"},"project_ids":{"anyOf":[{"maxLength":600,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated project ids to limit the report to (up to 100); empty for all projects.","title":"Project Ids"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many projects per page (1 to 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Pagination cursor: pagination.cursor from the previous answer. Leave out for the first page.","title":"Cursor"}},"required":["org_id","from_time","to_time","granularity","metrics"],"title":"get_project_consumptionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_branch_consumption":{"post":{"operationId":"get_branch_consumption","summary":"Report consumption metrics per branch for chosen projects over a time range. Each project has periods (billing intervals","description":"Report consumption metrics per branch for chosen projects over a time range. Each project has periods (billing intervals with plan and dates) holding timeframes with metric values. Use for \"Which branch of my Neon project used the most storage last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_ids":{"description":"Comma-separated project ids to include (1 to 100).","maxLength":600,"title":"Project Ids","type":"string"},"org_id":{"description":"Organization id (from the organization list) whose projects are reported.","maxLength":100,"title":"Org Id","type":"string"},"from_time":{"description":"Start of the period as an ISO 8601 date-time, for example 2026-10-01T00:00:00Z (rounded to the granularity; earliest 2024-03-01).","maxLength":40,"title":"From Time","type":"string"},"to_time":{"description":"End of the period as an ISO 8601 date-time, for example 2026-10-15T00:00:00Z.","maxLength":40,"title":"To Time","type":"string"},"granularity":{"description":"Bucket size: hourly (last 168 hours), daily (last 60 days) or monthly (last year).","enum":["hourly","daily","monthly"],"title":"Granularity","type":"string"},"metrics":{"description":"Comma-separated metrics: compute_unit_seconds, root_branch_bytes_month, child_branch_bytes_month, instant_restore_bytes_month, public_network_transfer_bytes, private_network_transfer_bytes, extra_branches_month, snapshot_storage_bytes_month.","maxLength":300,"title":"Metrics","type":"string"},"branch_ids":{"anyOf":[{"maxLength":600,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated branch ids to limit the report to (up to 100); empty for all branches of the projects.","title":"Branch Ids"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many branches per page (1 to 1000).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Pagination cursor: pagination.cursor from the previous answer. Leave out for the first page.","title":"Cursor"}},"required":["project_ids","org_id","from_time","to_time","granularity","metrics"],"title":"get_branch_consumptionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_legacy_project_consumption":{"post":{"operationId":"get_legacy_project_consumption","summary":"Report consumption per project for legacy Scale, Business and Enterprise plans over a time range: active time, compute t","description":"Report consumption per project for legacy Scale, Business and Enterprise plans over a time range: active time, compute time, written data and data transfer per timeframe. Reads do not wake compute. Use for \"How much compute time did my Neon projects use on the legacy plan this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"from_time":{"description":"Start of the period as an ISO 8601 date-time, for example 2026-10-01T00:00:00Z (rounded to the granularity; earliest 2024-03-01).","maxLength":40,"title":"From Time","type":"string"},"to_time":{"description":"End of the period as an ISO 8601 date-time, for example 2026-10-15T00:00:00Z.","maxLength":40,"title":"To Time","type":"string"},"granularity":{"description":"Bucket size: hourly (last 168 hours), daily (last 60 days) or monthly (last year).","enum":["hourly","daily","monthly"],"title":"Granularity","type":"string"},"org_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Organization id whose projects are reported; empty for the key owner's own projects.","title":"Org Id"},"project_ids":{"anyOf":[{"maxLength":600,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated project ids to limit the report to; empty for all projects.","title":"Project Ids"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many projects per page (1 to 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Pagination cursor: pagination.cursor from the previous answer. Leave out for the first page.","title":"Cursor"}},"required":["from_time","to_time","granularity"],"title":"get_legacy_project_consumptionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_organization_spending_limit":{"post":{"operationId":"get_organization_spending_limit","summary":"Show the monthly spending limit of an organization in cents. Use for \"What is the spending limit of my Neon organization","description":"Show the monthly spending limit of an organization in cents. Use for \"What is the spending limit of my Neon organization\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"org_id":{"description":"Neon organization id, for example 'org-cool-leaf-12345678', as returned by the organization list.","maxLength":100,"title":"Org Id","type":"string"}},"required":["org_id"],"title":"get_organization_spending_limitArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_project_branches":{"post":{"operationId":"count_project_branches","summary":"Count the branches of a project, optionally only those whose name or id contains some text. Use for \"How many branches d","description":"Count the branches of a project, optionally only those whose name or id contains some text. Use for \"How many branches does my Neon project have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Neon project id, for example 'cool-leaf-12345678', as returned by the project list.","maxLength":100,"title":"Project Id","type":"string"},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only count branches whose name or id contains this text.","title":"Search"}},"required":["project_id"],"title":"count_project_branchesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}