vrsai Sql API
The sql API from vrsai, for sql.
Operations 1
POST
/v1/capabilities/sql_preflight
Check PostgreSQL SQL immediately before execution to prevent destructive or…
#
The sql API from vrsai, for sql.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/vrsai-tech:vrsai-tech-sql-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Vrsai Tech Sql API
version: 1.0.0
contact:
name: vrsai
email: agents@vrsai.tech
url: https://vrsai.tech
x-guidance: Select the operation whose published contract matches the task. Treat its version, schemas, examples, commercial metadata, and advertised protocol requirements as authoritative. Submit schema-valid input. Where payment is required, follow only the payment requirements advertised by that operation. Preserve payment identifiers and returned commercial evidence across retries and reconciliation when present. Do not infer unsupported behavior, guarantees, pricing, or protocol support beyond the published contract.
description: 'Operations tagged sql across 2 of this provider''s published API definitions: openapi.json, vrsai-tech-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.vrsai.tech
tags:
- name: sql
paths:
/v1/capabilities/sql_preflight:
post:
operationId: sql_preflight
summary: Check PostgreSQL SQL immediately before execution to prevent destructive or…
description: 'Call this immediately before an autonomous agent, coding assistant, or automated pipeline executes PostgreSQL write, DDL, or administrative SQL against a production-capable connection. It parses the complete statement set with a real PostgreSQL AST parser and prevents the costly mistake of an agent silently deleting, truncating, or dropping data it should not have touched. It detects unbounded DELETE and UPDATE (no WHERE clause), TRUNCATE, destructive DROP and CASCADE, mutation of caller-declared protected relations, and availability-sensitive DDL such as a non-concurrent CREATE INDEX or hazardous ALTER TABLE change. It returns a deterministic PROCEED, REVIEW, or BLOCK decision with stable reason codes, a per-statement inventory, and an explicit coverage report of exactly what was and was not assessed — parse failure and unparseable or unmodeled syntax always fail closed to REVIEW, never PROCEED. PostgreSQL is the only supported dialect in this version. Price: 50000 micro-USD per execution; terms revision sql-preflight-r2.'
tags:
- sql
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- sql
properties:
sql:
type: string
minLength: 1
maxLength: 65536
description: A complete PostgreSQL statement or semicolon-separated statement list.
context:
type: object
properties:
environment:
anyOf:
- type: string
const: production
- type: string
const: staging
- type: string
const: development
- type: string
const: unknown
protected_relations:
type: array
items:
type: string
maxItems: 200
protected_schemas:
type: array
items:
type: string
maxItems: 200
expected_statement_kinds:
type: array
items:
type: string
maxItems: 50
additionalProperties: false
policy:
type: object
properties:
block_unbounded_delete:
type: boolean
block_unbounded_update:
type: boolean
block_drop_table:
type: boolean
block_truncate:
type: boolean
block_cascade:
type: boolean
block_protected_relation_mutation:
type: boolean
alter_table_action:
anyOf:
- type: string
const: proceed
- type: string
const: review
- type: string
const: block
nonconcurrent_index_action:
anyOf:
- type: string
const: proceed
- type: string
const: review
- type: string
const: block
procedural_or_dynamic_sql_action:
anyOf:
- type: string
const: review
- type: string
const: block
unsupported_statement_action:
anyOf:
- type: string
const: review
- type: string
const: block
max_statements:
type: integer
minimum: 1
maximum: 20
additionalProperties: false
additionalProperties: false
example:
sql: DELETE FROM customers;
context:
environment: production
protected_relations:
- customers
responses:
'200':
description: Structured capability result.
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- capability
- request_id
- output
properties:
capability:
type: object
additionalProperties: false
required:
- id
- version
properties:
id:
const: sql_preflight
version:
const: 1.0.0
request_id:
type: string
output:
type: object
required:
- decision
- machine_action
- reason_codes
- ruleset_version
- coverage
- statement_count
- statements
- checks
- input_fingerprint
properties:
decision:
anyOf:
- type: string
const: PROCEED
- type: string
const: REVIEW
- type: string
const: BLOCK
machine_action:
anyOf:
- type: string
const: EXECUTE
- type: string
const: REQUIRE_REVIEW
- type: string
const: DO_NOT_EXECUTE
reason_codes:
type: array
items:
type: string
ruleset_version:
type: string
description: Version of the reason-code catalog and policy defaults that produced this result, independent of the capability's own contract version. See RULESET_VERSION in rules.ts.
coverage:
type: object
required:
- dialect
- assessment_scope
- complete_for_declared_scope
- checks_performed
- checks_not_performed
properties:
dialect:
type: string
const: postgresql
assessment_scope:
type: array
items:
type: string
complete_for_declared_scope:
type: boolean
checks_performed:
type: array
items:
type: string
checks_not_performed:
type: array
items:
type: string
additionalProperties: false
statement_count:
type: integer
minimum: 0
statements:
type: array
items:
type: object
required:
- index
- kind
- mutates_data
- changes_schema
- changes_privileges
- administrative
- relations
- decision
- reason_codes
properties:
index:
type: integer
minimum: 0
kind:
type: string
description: Normalized statement kind, e.g. DELETE, ALTER_TABLE.
mutates_data:
type: boolean
changes_schema:
type: boolean
changes_privileges:
type: boolean
administrative:
type: boolean
relations:
type: array
items:
type: object
required:
- name
properties:
schema:
type: string
name:
type: string
additionalProperties: false
decision:
anyOf:
- type: string
const: PROCEED
- type: string
const: REVIEW
- type: string
const: BLOCK
reason_codes:
type: array
items:
type: string
additionalProperties: false
checks:
type: array
items:
type: object
required:
- id
- status
properties:
id:
type: string
status:
anyOf:
- type: string
const: PASS
- type: string
const: REVIEW
- type: string
const: BLOCK
statement_index:
type: integer
minimum: 0
reason_code:
type: string
evidence:
type: object
patternProperties:
^.*$: {}
additionalProperties: false
input_fingerprint:
type: string
description: SHA-256 fingerprint ("v1:<hex>") of the exact submitted {sql, context, policy} tuple. Identical input and policy always produce the identical fingerprint, independent of commercial/payment mode. See fingerprint.ts.
additionalProperties: false
receipt:
type: object
description: Present after successful paid settlement in qualification/commerce mode.
replay:
type: boolean
description: True when returning a previously committed commercial result.
payment_identifier:
type: string
commercial:
type: object
additionalProperties: false
required:
- schema_version
- outcome
- economic_effect
- economic_effect_occurred_in_this_request
- retry
- next_action
properties:
schema_version:
const: '1'
outcome:
type: string
enum:
- completed
- completed_replay
economic_effect:
const: occurred
economic_effect_occurred_in_this_request:
type: boolean
retry:
type: object
additionalProperties: false
required:
- allowed
- mode
- replacement_authorization_allowed
properties:
allowed:
type: boolean
mode:
type: string
enum:
- no_retry
- corrected_request
- same_request
- same_authorization
- same_authorization_after_remediation
- fresh_authorization
- wait_and_query_status
replacement_authorization_allowed:
type: boolean
next_action:
type: object
additionalProperties: false
required:
- type
properties:
type:
type: string
enum:
- correct_request
- obtain_payment_authorization
- increase_asset_balance
- obtain_fresh_offer_and_authorize
- reuse_same_authorization
- retry_same_request
- wait_then_retry
- choose_supported_payment_terms
- stop
parameters:
type: object
additionalProperties: false
properties:
network:
type: string
asset:
type: string
required_amount:
type: string
pattern: ^[0-9]+$
capability_id:
type: string
example:
capability:
id: sql_preflight
version: 1.0.0
request_id: 01234567-89ab-cdef-0123-456789abcdef
output:
decision: BLOCK
machine_action: DO_NOT_EXECUTE
reason_codes:
- DELETE_WITHOUT_WHERE
- PROTECTED_RELATION_MUTATION
ruleset_version: 1.0.0
coverage:
dialect: postgresql
assessment_scope:
- unbounded_delete
- unbounded_update
- truncate
- destructive_drop
- destructive_cascade
- alter_table_hazards
- nonconcurrent_index
- create_extension
- protected_relation_mutation
- dynamic_or_procedural_sql
- expected_statement_kind
- multi_statement_evaluation
complete_for_declared_scope: true
checks_performed:
- unbounded_delete
- unbounded_update
- truncate
- destructive_drop
- destructive_cascade
- alter_table_hazards
- nonconcurrent_index
- create_extension
- protected_relation_mutation
- dynamic_or_procedural_sql
- expected_statement_kind
- multi_statement_evaluation
checks_not_performed:
- privilege_change
- explicit_locking
- alter_system
- availability_maintenance
- external_program_execution
- drop_schema_or_database
- read_cost_and_row_estimation
- sensitive_data_access_and_exfiltration
- tenant_isolation
- semantic_correctness
statement_count: 1
statements:
- index: 0
kind: DELETE
mutates_data: true
changes_schema: false
changes_privileges: false
administrative: false
relations:
- name: customers
decision: BLOCK
reason_codes:
- DELETE_WITHOUT_WHERE
- PROTECTED_RELATION_MUTATION
checks:
- id: parse_validity
status: PASS
- id: statement_count
status: PASS
evidence:
count: 1
- id: unbounded_delete
status: BLOCK
statement_index: 0
reason_code: DELETE_WITHOUT_WHERE
- id: protected_relation_mutation
status: BLOCK
statement_index: 0
reason_code: PROTECTED_RELATION_MUTATION
evidence:
relations:
- name: customers
- id: expected_statement_kind
status: PASS
statement_index: 0
input_fingerprint: v1:4634deedb0970b042098df09e6f8bf365f2ddb635a18742c5ffa676844e4fa62
'400':
description: Machine-readable 400 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'402':
description: Machine-readable 402 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'404':
description: Machine-readable 404 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'409':
description: Machine-readable 409 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'413':
description: Machine-readable 413 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'415':
description: Machine-readable 415 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'500':
description: Machine-readable 500 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'502':
description: Machine-readable 502 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'503':
description: Machine-readable 503 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'504':
description: Machine-readable 504 error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
security: []
x-payment-info:
price:
mode: fixed
currency: USD
amount: '0.050000'
protocols:
- x402: {}
x-vrsai-commercial:
canonicalPriceMicroUsd: '50000'
termsRevision: sql-preflight-r2
termsDigest: v1:32c4139e0ddcff728339a74323207236e38e4d87f3585d4cabe2cfefabf27621
x-x402:
version: 2
accepts:
- scheme: exact
network: eip155:8453
asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
amount: '50000'
- scheme: exact
network: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
asset: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
amount: '50000'
paymentIdentifierRequired: false
paymentRequiredHeader: PAYMENT-REQUIRED
paymentSignatureHeader: PAYMENT-SIGNATURE
paymentResponseHeader: PAYMENT-RESPONSE
x-vrsai-execution-bounds:
timeoutMs: 2000
maxInputBytes: 131072
x-vrsai-discovery:
aliases:
- SQL safety check
- PostgreSQL query preflight
- destructive SQL detection
- database statement guardrail
- SQL execution review
when_to_call: Call immediately before executing caller-supplied PostgreSQL SQL when execution hazards must be detected.
do_not_call_when:
- executing SQL or connecting to a database
- checking a SQL dialect other than PostgreSQL
- optimizing query performance or recommending indexes
- generating SQL from natural language or application code
- inspecting database contents, schemas, privileges, or execution plans
- explaining SQL without an imminent execution decision
- performing a general source-code or database security review
representative_queries:
- Is this SQL safe to run against a production PostgreSQL database?
- Will this DELETE statement remove every row in the table?
- Check this PostgreSQL migration for destructive changes before deployment.
- I need a SQL guardrail before my coding agent runs generated SQL.
- Does this SQL modify a protected production table?
x-vrsai-commercial-contract:
schemaVersion: '1'
outcomeCatalog: '#/x-vrsai-commercial-outcomes'
servers:
- url: https://api.vrsai.tech
components:
schemas:
ErrorEnvelope:
type: object
additionalProperties: false
required:
- error
properties:
error:
type: object
additionalProperties: false
required:
- schema_version
- code
- reason
- message
- retryable
- request_id
- economic_effect
- retry
- next_action
properties:
schema_version:
const: '1'
code:
type: string
enum:
- NOT_FOUND
- UNSUPPORTED_MEDIA_TYPE
- PAYLOAD_TOO_LARGE
- INVALID_REQUEST
- PAYMENT_REQUIRED
- PAYMENT_REJECTED
- PAYMENT_IDENTIFIER_INVALID
- PAYMENT_IDENTIFIER_CONFLICT
- PAYMENT_VERIFICATION_UNAVAILABLE
- PAYMENT_AUTHORIZATION_CONFLICT
- PURCHASE_ALREADY_SETTLED
- COMMERCIAL_STATE_PENDING
- SETTLEMENT_PENDING
- SETTLEMENT_UNKNOWN
- SETTLEMENT_WITHHELD
- RECEIPT_UNAVAILABLE
- EXECUTION_DEADLINE_EXCEEDED
- CAPABILITY_EXECUTION_FAILED
- CAPABILITY_OUTPUT_INVALID
- SERVICE_UNAVAILABLE
- INTERNAL_ERROR
reason:
type: string
enum:
- resource_not_found
- unsupported_media_type
- payload_too_large
- malformed_json
- invalid_capability_input
- payment_required
- malformed_payment_signature
- invalid_payment_signature
- payment_requirements_mismatch
- payment_identifier_invalid
- payment_identifier_conflict
- insufficient_balance
- authorization_not_yet_valid
- authorization_expired
- facilitator_unavailable
- facilitator_rejected
- authorization_conflict
- purchase_already_settled
- verification_pending
- execution_pending
- settlement_pending
- settlement_outcome_unknown
- settlement_failed
- result_unavailable
- receipt_unavailable
- execution_timeout
- execution_failed
- capability_output_invalid
- result_too_large
- service_unavailable
- commercial_outcome_unknown
- commercial_processing_unknown
- internal_error
message:
type: string
retryable:
type: boolean
request_id:
type: string
payment_identifier:
type: string
economic_effect:
type: string
enum:
- none
- occurred
- unknown
retry:
type: object
additionalProperties: false
required:
- allowed
- mode
- replacement_authorization_allowed
properties:
allowed:
type: boolean
mode:
type: string
enum:
- no_retry
- corrected_request
- same_request
- same_authorization
- same_authorization_after_remediation
- fresh_authorization
- wait_and_query_status
replacement_authorization_allowed:
type: boolean
next_action:
type: object
additionalProperties: false
required:
- type
properties:
type:
type: string
enum:
- correct_request
- obtain_payment_authorization
- increase_asset_balance
- obtain_fresh_offer_and_authorize
- reuse_same_authorization
- retry_same_request
- wait_then_retry
- choose_supported_payment_terms
- stop
parameters:
type: object
additionalProperties: false
properties:
network:
type: string
asset:
type: string
required_amount:
type: string
pattern: ^[0-9]+$
capability_id:
type: string
x-refined-from:
- openapi.json
# --- truncated at 32 KB (52 KB total) ---
# Full source: https://artifacts.apis.io/vrsai-tech/openapi/vrsai-tech-sql-api-openapi.yml