Skip to main content

API Reference

This section documents the public Tuturuuu HTTP API. It is reference material for integrators calling Tuturuuu endpoints from outside the platform.
Tuturuuu is mid-migration from the legacy apps/web Next.js platform (port 7803) to a TanStack Start frontend plus a dedicated Rust backend (port 7820). Endpoint hosts and paths may shift as routes move behind the Rust backend. See Tanstack + Rust migration for the current state.

What this API covers

This section documents the OpenAI-compatible AI Studio API, including responses, chat completions, embeddings, images, and versioned agents. See AI Studio API. The older Generate AI Completion endpoint remains available as a compatibility adapter. The full surface of internal and migrated platform routes is defined by the backend OpenAPI contract rather than enumerated here.

Authentication

Authentication depends on the endpoint:
  • AI-only bearer keys. AI Studio endpoints authenticate with a hash-only ttr_ai_ workspace credential in the Authorization: Bearer header. These keys can call only AI Studio endpoints and are restricted by workspace, model, expiry, rate, and optional credit-budget policy.
  • Legacy workspace API keys. The compatibility AI generate endpoint still accepts its existing request-body accessKey contract while integrations migrate to AI Studio.
  • Bearer tokens / session cookies. Migrated platform routes behind the Rust backend authenticate the caller’s Supabase session — either a browser session cookie or a Bearer token — and some accept app-session tokens. These routes are not general-purpose public endpoints; they back first-party Tuturuuu apps.
Never commit API keys or tokens. Reference credentials by environment variable name and supply them at request time.

Canonical OpenAPI specification

The authoritative machine-readable contract for the Rust backend lives in the repository at:
This Tuturuuu Rust Backend API spec is the source of truth for migrated routes, their request/response schemas, security requirements, and status codes. The legacy public API also lives under apps/web/src/app/api/v1 until the corresponding routes finish moving behind the Rust backend.