Realm Docs
  • Welcome
  • Getting Started
    • Quickstart
  • Basics
    • Image Gen
    • Video Generation
    • Authentication
    • Create or Edit Model
    • MarketPlace
    • Users
  • Advanced
    • Idempotency
  • Rate Limiting
  • Security
  • Versions
  • Webhooks
Powered by GitBook
On this page
  • AI Model Creation API
  • Base URL
  1. Basics

Create or Edit Model

AI Model Creation API

This API allows you to create, train, and manage the foundational AI models used for generating influencers and content.

Base URL

https://api.realm.ai/v1/models


Create Base Model

Initiates the creation of a new base AI model from predefined templates or foundational models.

  • Method: POST

  • Endpoint: /

  • Authentication: API Key

Request Body

{
  "name": "My Custom Model",
  "description": "A model specialized for cyberpunk aesthetics",
  "baseModel": "realm-base-v2.1", // Specify a REALM foundational model
  "tags": ["cyberpunk", "female", "photorealistic"]
}

Response 201 Created

{
  "modelId": "mod_zyx987",
  "name": "My Custom Model",
  "description": "A model specialized for cyberpunk aesthetics",
  "status": "pending_training", // Model needs training data
  "createdAt": "2024-03-10T12:00:00Z",
  "tags": ["cyberpunk", "female", "photorealistic"]
}

Upload Training Data

Uploads image data to train or fine-tune a specific model. This is an asynchronous operation.

  • Method: POST

  • Endpoint: /{modelId}/train

  • Authentication: API Key

  • Content-Type: multipart/form-data

Request Body Parameters

  • images (file array): Multiple image files (JPEG, PNG) to use for training.

  • trainingParams (JSON string, optional): Advanced training parameters (e.g., learning rate, steps).

    {
      "steps": 1500,
      "learningRate": 0.0001
    }

Response 202 Accepted

{
  "modelId": "mod_zyx987",
  "status": "training_queued",
  "trainingJobId": "train_abc123",
  "estimatedCompletion": "2024-03-10T14:30:00Z"
}

Get Model Details

Retrieves details for a specific AI model, including its current status.

  • Method: GET

  • Endpoint: /{modelId}

  • Authentication: API Key

Response 200 OK

{
  "modelId": "mod_zyx987",
  "name": "My Custom Model",
  "description": "A model specialized for cyberpunk aesthetics",
  "status": "active", // e.g., pending_training, training, active, failed
  "baseModel": "realm-base-v2.1",
  "createdAt": "2024-03-10T12:00:00Z",
  "lastTrainedAt": "2024-03-10T14:25:00Z",
  "tags": ["cyberpunk", "female", "photorealistic"]
}

List User Models

Retrieves a list of AI models owned by the authenticated user.

  • Method: GET

  • Endpoint: /

  • Authentication: API Key

  • Query Parameters:

    • limit (int, optional, default: 20): Number of results per page.

    • offset (int, optional, default: 0): Pagination offset.

    • status (string, optional): Filter by model status (e.g., active).

Response 200 OK

{
  "data": [
    {
      "modelId": "mod_zyx987",
      "name": "My Custom Model",
      "status": "active",
      "createdAt": "2024-03-10T12:00:00Z"
    },
    {
      "modelId": "mod_uvw456",
      "name": "Anime Style v1",
      "status": "active",
      "createdAt": "2024-02-20T10:00:00Z"
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 2
  }
}

Delete Model

Deletes a specific AI model. This action is irreversible.

  • Method: DELETE

  • Endpoint: /{modelId}

  • Authentication: API Key + Signature Authentication

Response 204 No Content

PreviousAuthenticationNextMarketPlace

Last updated 1 month ago