docsHTTP APIReference

API Reference

Ontyx exposes two API surfaces: the control plane (account management, keys, billing, usage) and the product API (geospatial data queries). This page documents the control plane, which is the only surface available today.

Control Plane

Control plane endpoints are authenticated with a session cookie (ontyx_session) issued at sign-in. They are used by the dashboard and are not intended for programmatic access from application code. All endpoints return JSON. Errors follow the shape { "error": { "code": "string", "message": "string" } }.

User

MethodPathResponseNotes
GET/meMeResponseReturns current user identity and entitlements

MeResponse shape:

{
  "userId": "usr_...",
  "email": "you@example.com",
  "entitlements": {
    "hasSubscription": true
  }
}

API Keys

MethodPathResponseNotes
GET/api-keysListApiKeysResponseReturns metadata for all keys in the caller’s account; plaintext is never returned
POST/api-keysCreateApiKeyResponseCreates a key; returns plaintext exactly once in plaintext field
DELETE/api-keys/:id204 No ContentRevokes the key; returns 404 if the key does not exist or belongs to another user

CreateApiKeyResponse shape:

{
  "plaintext": "ontyx_live_ak_<keyId>_<secret>",
  "key": {
    "keyId": "EGKCZE3PBGZ0FZHTH1DX4HCVEQ",
    "env": "live",
    "name": "claude-desktop",
    "scopes": ["read:data"],
    "createdAt": "2026-05-15T00:00:00.000Z"
  }
}

plaintext is the full bearer token to send in the Authorization header. It is returned once — re-fetching the key over GET /api-keys never includes it.

Subscription

MethodPathResponseNotes
GET/subscriptionSubscriptionResponseReturns current subscription status and period
POST/subscriptionSubscriptionResponseStarts checkout; returns 409 if subscription is already active
DELETE/subscriptionSubscriptionResponseCancels the subscription; returns 404 if not active
POST/billing/portal{ url: string }Opens a billing portal session; redirects via returned URL

Usage

MethodPathResponseNotes
GET/usageUsageResponseReturns current period, credits consumed, allotment, and quota state

UsageResponse shape:

{
  "period": "2026-07",
  "used": 450,
  "quota": 1000,
  "percent": 45,
  "state": "ok",
  "mode": "standard"
}

quota is the monthly credit allotment for the caller’s plan and mode is "free" or "standard". state is one of "ok" (under 80%), "warning" (80–100%), or "over" (above the allotment).

Overage behavior depends on the plan: on Standard, overage is soft — requests are not rejected when state is "over". On the free tier, the monthly credits are a hard cap; once they’re used up, data calls return a structured QUOTA_EXCEEDED result until credits reset at the start of the next month.

Credits

Usage is metered in credits. Every currently shipped call type costs 1 credit, metered only when the call succeeds:

Call typeToolsCredits
Demographic lookup (ACS)get_population, get_average_income1
Location lookupgeocode, reverse_geocode, search_nearby1
Static map renderstatic_map1

Failed calls — validation errors, unknown zips, upstream service failures — are never metered.

Premium datasets (HUD rent benchmarks, CMBS, composite indices) will carry higher per-call credit costs when they ship; this table is the authoritative place to check. Monthly allotments per plan are listed on the pricing page.

Product API

[TODO: documented post-MCP-launch]

The product API is the data-serving surface that your agents and applications call directly. It uses bearer token authentication (see Authentication) and will expose geospatial query endpoints corresponding to the MCP tools described in Available Tools.

This section will be expanded once the MCP server and direct HTTP data API enter public availability.