canonical: https://jentic.com/apis/aifordatabase.com/aifordatabase

# AI for Database API

The AI for Database API connects an agent to your SQL and NoSQL databases and turns natural-language chat into real queries against them. It introspects a connection's schema, runs read and write queries, saves and reruns named queries, and routes risky statements through an approval workflow before they execute. Beyond querying, it builds dashboards and widgets, defines reusable metrics, and fires webhooks on activity, so an agent can both answer questions from live data and assemble reporting on top of it.

## For AI agents

Query connected SQL and NoSQL databases from natural language, run and save queries, define metrics, and build dashboards and widgets, with an approval step for sensitive statements.

## Scope

Does not handle database hosting, provisioning, or backups. Use for querying connected databases and building reporting on top of them only.

## Capabilities

- Introspect a database connection's schema before composing a query
- Translate a natural-language chat message into an executable query
- Run saved queries on demand and read back their results
- Assemble dashboards with widgets backed by live query results
- Define named metrics and read their current computed value
- Route sensitive queries through an approval rule before they run
- Register webhook endpoints and inspect their delivery history

## Use cases

### Natural-language data answers inside an agent

An AI agent connected through Jentic answers business questions directly from live database data: it reads the connection schema, composes a query from the user's natural-language request, executes it, and returns the rows. Because the agent discovers operations by intent, it can go from a question like 'what were our top five accounts last quarter' to a real result without a developer hand-writing the query path.

Example prompt: Introspect the schema for a connection, build a query that returns the top five accounts by revenue for the last quarter, execute it, and return the rows

### Governed query execution with approvals

Teams that let an agent touch production data can gate risky statements behind approval rules. A query the agent submits is held pending until a human approves or rejects it, and the agent can poll the decision before anything runs. This keeps destructive or large statements under review while routine reads flow through, so data access can be delegated without handing over unconditional write power.

Example prompt: Submit a bulk update query for approval, poll its status until a reviewer approves it, then confirm the statement executed

### Automated dashboards and metrics

The API lets an agent assemble reporting on top of a connection: it creates dashboards, adds widgets bound to query results, and defines named metrics whose values it can read back on demand. This turns ad hoc questions into durable, reusable reporting that an agent can refresh and cite later, rather than recomputing the same figures from scratch each time.

Example prompt: Create a dashboard, add a widget bound to a monthly-revenue query, define a metric for active users, and read back its current value

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/connections` | Create a database connection |
| POST | `/connections/{id}/query` | Execute a query on a connection |
| POST | `/chat` | Send a natural-language message |
| GET | `/dashboards` | List dashboards |
| POST | `/dashboards/{id}/widgets` | Create a dashboard widget |
| POST | `/saved-queries/{id}/run` | Execute a saved query |
| GET | `/metrics/{id}/value` | Get a metric's current value |
| POST | `/queries/submit` | Submit a query for approval |

## Key resources

- **Connections** — Register, test, and introspect database connections, and run queries against them
- **Chat & Conversations** — Send natural-language messages and keep multi-turn conversation history
- **Dashboards & Widgets** — Create dashboards and add widgets backed by query results
- **Metrics** — Define named metrics and read their current computed value
- **Saved Queries** — Store named queries and rerun them on demand
- **Query Approval** — Submit queries for review and track approve or reject decisions
- **Webhooks** — Register endpoints and inspect their delivery history

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 60 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 47 / 100
  - Developer Experience & Jentic Compatibility: 62 / 100
  - AI-Readiness & Agent Experience: 49 / 100
  - Agent Usability: 89 / 100
  - Security: 60 / 100
  - AI Discoverability: 78 / 100
- **View full report:** https://jentic.com/apis/aifordatabase.com/aifordatabase/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the AI for Database API by hand means handling its bearer-token auth, learning its connection and query model, and managing the approval flow for writes yourself. Through Jentic you install once, import the API from the Directory, store the token once, and your agent calls it.
- **Permission scoping:** The API puts the connection id in the URL path, so a rule can pin your agent to one connection and the operations you pick: you can allow schema reads and query execution while leaving connection deletion or credential rotation out unless you add them.
- **Credential handling:** Your bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a query on a database' or 'build a dashboard widget', and Jentic returns the matching AI for Database operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Metabase** — Metabase builds dashboards and runs queries through a hosted BI layer rather than agent-driven chat
- **Supabase** — Supabase hosts the Postgres database that the AI for Database API can connect to and query
- **Snowflake** — Snowflake is a data warehouse an agent can analyze alongside the operational databases queried here

## FAQ

### What authentication does the AI for Database API use?

The AI for Database API authenticates with a bearer token sent in the Authorization header, as declared in its OpenAPI spec. Through Jentic the token is stored once by your own self-hosted instance and injected at call time, so it never appears in the agent's prompt or logs.

### Can I run queries against my own database with the AI for Database API?

Yes. You register a connection, introspect its schema, and run read or write queries against it, and the API can translate a natural-language chat message into the query it executes. You can also save a query and rerun it later or submit it for approval first.

### Is there an AI for Database API MCP server?

You do not need an MCP server to give your agent the AI for Database API. Jentic connects it directly from the API Directory: import the API, store your bearer token once, and your agent calls its operations on demand without loading another server's tool definitions into its context.

### Can I limit what my agent is allowed to do with the AI for Database API?

Yes. Write a rule that allows only the schema-read and query-execution operations for one connection, so the agent can answer questions from that database and nothing else, and route any write through the approval queue. Every call it makes is logged for review.

### What are the rate limits for the AI for Database API?

The OpenAPI spec does not specify rate limits for the AI for Database API. Check the vendor documentation at https://www.aifordatabase.com for current limits before running high-volume query workloads.

### How do I answer a data question with the AI for Database API through Jentic?

Search Jentic for an intent such as 'query a connected database', and it returns the matching operation with its input schema so your agent can introspect the schema, run the query, and read back the rows. To run it on your own infrastructure, install Jentic One from its GitHub repo.
