Skip to main content
The Cloud API is a production-ready backend service that provides all the server-side functionality for your AI applications. Production Servers: Both servers provide identical functionality. Your Starter Kit connects to one of these servers based on your environment configuration.

What It Provides

Authentication Services

  • User registration: Create new user accounts with email and password
  • Login/logout: Secure authentication with JWT tokens
  • Token refresh: Automatic token renewal for continuous sessions
  • Email verification: Verify user email addresses
  • Password reset: Secure password recovery flow
  • Session management: Handle user sessions across devices

Project Management

  • Project CRUD: Create, read, update, and delete projects
  • API key generation: Create project-scoped authentication keys
  • Key management: List, revoke, and track API key usage
  • Project isolation: Multi-tenant architecture ensures data separation

AI Generation

  • Image generation: Create AI images using Replicate models
  • Status tracking: Monitor generation progress and completion
  • History management: Access past generations for authenticated users
  • Public sharing: Toggle image visibility for sharing
  • Anonymous generation: Support for unauthenticated generation flows

Health & Monitoring

  • Health checks: Verify API availability and status
  • Database status: Check backend database connectivity
  • Storage status: Verify file storage availability
  • Detailed diagnostics: Get comprehensive system information

How Authentication Works

JWT Token Flow

1

User logs in

Starter Kit sends email/password to /api/v1/auth/login
2

API validates credentials

Cloud API checks credentials and generates tokens
3

Tokens returned

Access token (30 min) and refresh token (7 days) sent to client
4

Tokens stored

Starter Kit stores tokens in httpOnly cookies for security
5

Authenticated requests

Subsequent requests include JWT token automatically

Required Headers

All API requests from your Starter Kit include these authentication headers:
  • X-User-Role: Identifies the user type (end_user for Starter Kit users)
  • X-Developer-Key: Your developer credential from Cloud Admin
  • X-Project-ID: Your project’s unique identifier (UUID format)
  • X-API-Key: Your project’s API key
  • Authorization: JWT token for authenticated user requests

Role-Based Access

Different user types have different access levels to API endpoints:
Endpoint GroupOperatorDeveloperEnd User
Health Check
Authentication
Project Management✅ Own projects
AI Generation✅ Project-scoped
Learn more about each user type and their capabilities in the User Types guide.

API Endpoints

The Cloud API is organized into logical groups:

Health Check Endpoints

Authentication Endpoints

Project Endpoints

Generation Endpoints

Integration with Starter Kit

The Starter Kit is pre-configured to work with the Cloud API:
  1. Environment variables set the API URL and credentials
  2. Deployment mode validates configuration on startup
  3. Server actions in app/actions.ts call API endpoints
  4. Authentication context manages user state from API responses
  5. Headers automatically included in all requests

Rate Limits & Quotas

Rate limits and quotas depend on your plan. Contact support for details about upgrading or custom limits.

API Documentation

For detailed endpoint documentation, request/response examples, and parameter descriptions, see the Cloud API Reference section.

Next Steps