Skip to content

Nyuchi API overview

The Nyuchi API is a single FastAPI gateway hosted at api.nyuchi.com. Every product surface is mounted under /v1/<name>/* and is backed by its own Supabase project, so each product can scale, isolate, and meter independently. A single Stytch-derived platform JWT authorises requests across every namespace.

Use this guide when you need to call a product surface from a frontend, a server-to-server integration, or a partner application.

EnvironmentBase URL
Productionhttps://api.nyuchi.com
Local developmenthttp://localhost:8080

All product endpoints live under the /v1 prefix. The API version is reported by GET / in the api_version field. Legacy /api/* paths from earlier releases no longer resolve—update existing clients to /v1/*.

Each namespace maps to a dedicated Supabase project.

NamespaceDatabasePurpose
/v1/auth, /v1/identity, /v1/family, /v1/organization, /v1/api-keys, /v1/content, /v1/directory, /v1/places, /v1/travel, /v1/events, /v1/applications, /v1/ubuntu, /v1/pipeline, /v1/admin, /v1/search, /v1/media, /v1/couch, /v1/dashboardnyuchi_platform_dbIdentity, multi-tenancy, places, events, content, business directory, admin
/v1/commercemukoko_bushtrade_dbProducts, offers, businesses, inquiries, scam reports
/v1/pay/wallet, /v1/pay/tokens, /v1/pay/gatewaynyuchi_pay_dbWallets, token lifecycle, fiat on/off-ramps
/v1/logisticsnyuchi_logistics_dbVehicles, bookings, drivers, locations
/v1/lingomukoko_lingo_dbPhrases, languages, study sessions, XP, progress
/v1/newsmukoko_news_dbArticles, journalists, organisations, engagement
/v1/weather(reserved)Placeholder until a weather backend is selected

Every protected endpoint accepts the same platform JWT. Obtain a token from the Stytch-backed auth pipeline at /v1/auth/*, then send it on subsequent requests.

GET /v1/lingo/me/xp HTTP/1.1
Host: api.nyuchi.com
Authorization: Bearer <platform-jwt>

The same token works across every namespace. Some read endpoints accept anonymous calls (get_optional_user) and return public data; mutating endpoints require an authenticated caller (get_current_user).

GET / reports the gateway version and whether each product database is wired up. Use it to confirm what the deployed environment can serve.

Terminal window
curl https://api.nyuchi.com/
{
"name": "Nyuchi API",
"version": "4.1.0",
"api_version": "v1",
"namespaces": ["/v1/auth", "/v1/commerce", "/v1/pay", "..."],
"product_dbs": {
"commerce": true,
"pay": false,
"logistics": true,
"lingo": true,
"news": true
}
}

A false entry means the gateway has no credentials for that database. Routers in that namespace return HTTP 503 at request time so the rest of the gateway keeps working.

The gateway reads one environment-variable triplet per database. Set them as Fly secrets before deploying.

Terminal window
# Platform DB (legacy names retained for backward compatibility)
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
SUPABASE_SECRET_KEY=sb_secret_...
# Per-product DBs — substitute COMMERCE / PAY / LOGISTICS / LINGO / NEWS
COMMERCE_SUPABASE_URL=https://<project>.supabase.co
COMMERCE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
COMMERCE_SUPABASE_SECRET_KEY=sb_secret_...

Routers depend on the secret key; the publishable key is optional and only used for RLS-scoped clients.

StatusMeaning
401 UnauthorizedMissing or invalid platform JWT on a protected endpoint.
404 Not FoundResource does not exist in the namespace’s database.
501 Not ImplementedEndpoint exists but its underlying schema is not provisioned (currently /v1/pay/* and /v1/weather/forecast).
503 Service UnavailableThe product database for this namespace is not configured in the running environment.