Skip to main content

Dedicated PostgreSQL

Each ZeroDB project can provision a dedicated PostgreSQL instance backed by isolated Railway infrastructure. Unlike shared databases, your instance gets its own CPU, memory, and storage — with a direct connection string you can use from any Postgres client.

Base URL: https://api.ainative.studio/api/v1

Plan requirement

Dedicated PostgreSQL is available on BASIC, PROFESSIONAL, and ENTERPRISE plans. FREE accounts cannot provision instances. Upgrade at ainative.studio/pricing.


Instance Sizes

SizePriceCPURAMStorage
micro-1$5/month0.25 vCPU256 MB1 GB
standard-2$10/month0.5 vCPU512 MB5 GB
standard-4$25/month1 vCPU1 GB20 GB
performance-8$50/month2 vCPU2 GB50 GB
performance-16$100/month4 vCPU4 GB100 GB

Provision an Instance

POST/api/v1/projects/{project_id}/postgres🔒

Starts provisioning a dedicated PostgreSQL instance for your project. Provisioning runs in the background — use the status endpoint to poll for completion (~2–3 minutes).

curl -X POST https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"instance_size": "micro-1",
"postgres_version": "15"
}'
import requests

response = requests.post(
f"https://api.ainative.studio/api/v1/projects/{project_id}/postgres",
headers={"Authorization": f"Bearer {token}"},
json={
"instance_size": "micro-1",
"postgres_version": "15"
}
)
print(response.json())

Request body:

ParameterTypeRequiredDefaultDescription
instance_sizestringYesOne of: micro-1, standard-2, standard-4, performance-8, performance-16
postgres_versionstringNo"15"PostgreSQL major version: "13", "14", or "15"

Response:

{
"success": true,
"message": "PostgreSQL provisioning started",
"project_id": "fbf6a70c-00c9-4738-ad00-53eb4f79553e",
"instance_size": "micro-1",
"postgres_version": "15",
"estimated_completion_time_minutes": 3,
"status": "provisioning"
}
One instance per project

Each project supports one dedicated PostgreSQL instance. Attempting to provision again on an active project returns a 400 error.


Check Instance Status

GET/api/v1/projects/{project_id}/postgres🔒

Poll this endpoint after provisioning to check when the instance is ready.

curl https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres \
-H "Authorization: Bearer $TOKEN"

Response:

{
"exists": true,
"status": "active",
"instance_size": "micro-1",
"postgres_version": "15",
"database_host": "nozomi.proxy.rlwy.net",
"database_port": 38632,
"database_name": "zerodb_14ba393a",
"database_user": "zerodb_user",
"monthly_cost_usd": 5.00,
"provisioning_completed_at": "2026-04-26T02:08:12Z"
}

Status values:

StatusMeaning
provisioningInstance is being created (~2–3 min)
activeReady to accept connections
maintenanceTemporarily unavailable (restart in progress)
errorProvisioning or runtime failure — contact support

Get Connection Details

GET/api/v1/projects/{project_id}/postgres/connection🔒

Returns the full connection string and individual credentials for use with psql, TablePlus, DBeaver, or any application driver.

curl https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres/connection \
-H "Authorization: Bearer $TOKEN"

Response:

{
"connection_string": "postgresql://zerodb_user:your_password@nozomi.proxy.rlwy.net:38632/zerodb_14ba393a",
"host": "nozomi.proxy.rlwy.net",
"port": 38632,
"database": "zerodb_14ba393a",
"username": "zerodb_user",
"password": "your_password",
"ssl_required": true
}

Connect with psql:

psql "postgresql://zerodb_user:your_password@nozomi.proxy.rlwy.net:38632/zerodb_14ba393a"

Connect with Python (psycopg2):

import psycopg2

conn = psycopg2.connect(
host="nozomi.proxy.rlwy.net",
port=38632,
dbname="zerodb_14ba393a",
user="zerodb_user",
password="your_password",
sslmode="require"
)

Connect with SQLAlchemy:

from sqlalchemy import create_engine

engine = create_engine(
"postgresql://zerodb_user:your_password@nozomi.proxy.rlwy.net:38632/zerodb_14ba393a",
connect_args={"sslmode": "require"}
)
Keep credentials secure

Store your connection string in environment variables — never hardcode it. The password is encrypted at rest in ZeroDB.


Rotate Credentials

POST/api/v1/projects/{project_id}/postgres/rotate🔒

Generates a new password for your instance. The old password is invalidated immediately — update all active connections.

curl -X POST https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres/rotate \
-H "Authorization: Bearer $TOKEN"

Usage Statistics

GET/api/v1/projects/{project_id}/postgres/usage🔒

Returns CPU, memory, storage, and connection metrics for your instance.

curl https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres/usage \
-H "Authorization: Bearer $TOKEN"

Response:

{
"cpu_usage_percent": 4.2,
"memory_usage_percent": 18.7,
"storage_usage_gb": 0.3,
"connection_count": 2,
"monthly_cost_usd": 5.00,
"instance_size": "micro-1"
}

Query Logs

GET/api/v1/projects/{project_id}/postgres/logs🔒

Returns recent SQL query logs with execution time and row counts.

curl "https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres/logs?limit=20" \
-H "Authorization: Bearer $TOKEN"

Restart Instance

POST/api/v1/projects/{project_id}/postgres/restart🔒

Restarts your PostgreSQL container. Active connections will be dropped briefly.

curl -X POST https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres/restart \
-H "Authorization: Bearer $TOKEN"

Delete Instance

DELETE/api/v1/projects/{project_id}/postgres🔒

Permanently deletes your PostgreSQL instance and all data. This cannot be undone.

curl -X DELETE https://api.ainative.studio/api/v1/projects/$PROJECT_ID/postgres \
-H "Authorization: Bearer $TOKEN"

For AI Agents

  • Poll status after provisioning — the instance is ready when status is "active"
  • Use the connection string directly with any Postgres driver — no ZeroDB API layer required for raw SQL
  • Combine with ZeroDB vectors for hybrid relational + semantic search — store structured data in Postgres, embeddings in the vector store, query both in parallel
  • Rotate credentials periodically as a security best practice — automate via a scheduled agent task

Infrastructure

Each dedicated instance is provisioned as an isolated Railway service in the AINative - Customer DBs workspace. Instances are:

  • Fully isolated from other customers
  • Accessible via a public TCP proxy (*.proxy.rlwy.net)
  • Named zerodb-{short_project_id}-{account} for dashboard visibility
  • Backed by the official postgres:15-alpine image