NW DB Documentation
Complete guide to NW DB API, SDK, and features
Getting Started
Sign up, create a workspace, and get your API key in minutes.
- 1. Sign up at nw-db-web and create your account with Google or email.
- 2. Create a workspace from the Dashboard.
- 3. Go to Settings > API Keys and create an API key.
- 4. Use the API key in your requests via X-API-Key header.
Authentication
NW DB supports two authentication methods:
- Bearer Token: Firebase ID token in Authorization header
- API Key: Generated key in X-API-Key header
# Bearer token authentication
curl https://api.nwdb.dev/api/v1/tables \
-H "Authorization: Bearer <FIREBASE_ID_TOKEN>" \
-H "X-Workspace-ID: <WORKSPACE_ID>"
# API key authentication
curl https://api.nwdb.dev/api/v1/tables \
-H "X-API-Key: nwdb_your_key_here" \
-H "X-Workspace-ID: <WORKSPACE_ID>"REST API
Auto-generated REST API from your schema. Full CRUD, filtering, and pagination.
List Tables
curl https://api.nwdb.dev/api/v1/tables \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123"Create Table
curl -X POST https://api.nwdb.dev/api/v1/tables \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{
"name": "customers",
"columns": [
{ "name": "name", "type": "string", "required": true },
{ "name": "email", "type": "string", "required": true },
{ "name": "age", "type": "number" }
]
}'Create Record
curl -X POST https://api.nwdb.dev/api/v1/records/customers/records \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{ "name": "John", "email": "john@example.com", "age": 30 }'List Records
curl "https://api.nwdb.dev/api/v1/records/customers/records?limit=50&offset=0" \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123"Execute SQL
curl -X POST https://api.nwdb.dev/api/v1/query \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{ "sql": "SELECT * FROM customers WHERE age > 25 LIMIT 10" }'GraphQL
Auto-generated GraphQL API via PostGraphile. Subscriptions, mutations, and queries.
curl -X POST https://api.nwdb.dev/api/v1/proxy/graphql \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{
"query": "{ allCustomers(first: 10) { nodes { name email age } } }"
}'MCP (Model Context Protocol)
Connect Claude, Gemini, or any AI agent directly to your database.
Claude Desktop Config
{
"mcpServers": {
"nwdb": {
"url": "https://api.nwdb.dev/api/v1/mcp/sse",
"headers": {
"X-API-Key": "nwdb_your_key_here",
"X-Workspace-ID": "your_workspace_id"
}
}
}
}Available Tools
| Tool | Description |
|---|---|
| query | Execute SQL query |
| list_tables | List all tables |
| describe_table | Get table schema |
| insert_record | Insert a record |
| vector_search | Semantic similarity search |
| upload_file | Upload file to storage |
Execute MCP Tool via API
curl -X POST https://api.nwdb.dev/api/v1/mcp/call \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{
"tool": "query",
"arguments": { "sql": "SELECT * FROM customers LIMIT 5" }
}'Vector Search
Built-in vector index for similarity search. Store embeddings and run semantic search.
Create Collection
curl -X POST https://api.nwdb.dev/api/v1/vectors/collections \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{ "name": "documents", "dimensions": 768 }'Upsert Vector
curl -X POST https://api.nwdb.dev/api/v1/vectors/collections/documents/upsert \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{
"id": "doc-1",
"embedding": [0.1, 0.2, 0.3, ...],
"content": "NW DB is an AI-native database",
"metadata": { "source": "docs", "category": "product" }
}'Search
curl -X POST https://api.nwdb.dev/api/v1/vectors/collections/documents/search \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '{
"embedding": [0.1, 0.2, 0.3, ...],
"topK": 10
}'CSV / JSON Import
Bulk import data via CSV or JSON format.
Import CSV
curl -X POST https://api.nwdb.dev/api/v1/import/csv/customers \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: text/csv" \
--data-binary @customers.csvImport JSON
curl -X POST https://api.nwdb.dev/api/v1/import/json/customers \
-H "X-API-Key: nwdb_xxx" \
-H "X-Workspace-ID: ws_abc123" \
-H "Content-Type: application/json" \
-d '[
{ "name": "John", "email": "john@example.com", "age": 30 },
{ "name": "Jane", "email": "jane@example.com", "age": 25 }
]'Realtime
Subscribe to database changes via WebSocket or Server-Sent Events.
// WebSocket connection
const ws = new WebSocket(
"wss://api.nwdb.dev/api/v1/realtime/ws"
);
ws.onopen = () => {
ws.send(JSON.stringify({
type: "subscribe",
table: "customers",
apiKey: "nwdb_your_key_here",
workspaceId: "ws_abc123",
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log("Change:", data);
// { type: "INSERT", table: "customers", record: {...} }
};SDK
Official SDK for Node.js and Python.
Node.js
npm install nwdb-sdkimport { NWDBClient } from "nwdb-sdk";
const db = new NWDBClient({
apiKey: "nwdb_your_key_here",
workspaceId: "ws_abc123",
});
// List tables
const tables = await db.tables.list();
// Query records
const customers = await db.from("customers")
.select("*")
.where("age", ">", 25)
.limit(10);
// Vector search
const results = await db.vectors
.collection("documents")
.search({ query: "AI database", topK: 5 });Python
pip install nwdbfrom nwdb import NWDBClient
db = NWDBClient(
api_key="nwdb_your_key_here",
workspace_id="ws_abc123",
)
# List tables
tables = db.tables.list()
# Query records
customers = db.query("SELECT * FROM customers WHERE age > 25 LIMIT 10")
# Vector search
results = db.vectors.collection("documents").search(
query="AI database",
top_k=5,
)Pricing
Hobby 3,500 JPY/month / Pro 7,800 / Team 19,800 / Scale 50,000 + usage. Full white-label Enterprise resale supported.
Hobby
3,500 JPY/mo
Pro
7,800 JPY/mo
Team
19,800 JPY/mo
warm-standby HA
Scale
50,000 JPY/mo
SLA 99.9%
Enterprise
100,000 JPY/mo〜
custom
Overage Pricing (Hobby tier — quotas scale with plan)
| Item | Included | Overage Rate |
|---|---|---|
| Database Storage | 2 GB | 110 JPY / GB |
| File Storage | 500 MB | 55 JPY / GB |
| API Calls | 100K / month | 1.1 JPY / 1K calls |
| Vector Items | 10K / month | 5.5 JPY / 1K writes |
| Vector Queries | 10K / month | 3.3 JPY / 1K queries |
| Background Jobs | 60 min / month | 1.1 JPY / min |
Interactive API Reference (Swagger UI)
Swagger UI# OpenAPI spec
curl https://api.nwdb.dev/api/v1/docs/openapi.json