Skip to main content

πŸ”Œ API Introduction

Nano Studio provides comprehensive API access for developers who want to integrate AI-powered image transformation, OCR, virtual try-on, and content generation capabilities into their applications.

Overview

The Nano Studio API allows you to:
  • Transform images using our 80+ AI templates across 19 categories
  • Extract text from images with advanced OCR technology
  • Generate virtual try-on experiences for fashion and retail
  • Create professional product photography with AI
  • Build AI models and avatars programmatically
  • Manage projects and user accounts
  • Handle subscriptions and billing

Base URL

All API endpoints use the following base URL:
https://nanostudio.cloud/api

Authentication

Nano Studio uses Bearer token authentication for secure API access:
curl -X POST "https://nanostudio.cloud/api/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "base64_encoded_image_data",
    "template": "Joyful Laugh",
    "templateType": "expressions"
  }'

Getting Your API Key

  1. Sign up for a Nano Studio account at https://nanostudio.cloud
  2. Navigate to Account Settings β†’ API Keys
  3. Generate a new API key
  4. Copy your key and store it securely

Rate Limits

API usage is limited based on your subscription plan:
  • Free Plan: 50 transformations per month
  • Pro Plan: 500 transformations per month
  • Enterprise: Unlimited transformations
Per-endpoint rate limits:
  • Image Generation: 10 requests per minute
  • OCR Processing: 15 requests per minute
  • Virtual Try-On: 10 requests per minute
  • Product Generation: 10 requests per minute
  • Model Generation: 10 requests per minute

Quick Start

1. Make Your First Request

# Install dependencies (Node.js)
npm install axios

# Make a transformation request
const axios = require('axios');

async function transformImage() {
  try {
    const response = await axios.post(
      'https://nanostudio.cloud/api/generate',
      {
        image: "base64_encoded_image_data",
        template: "Joyful Laugh",
        templateType: "expressions"
      },
      {
        headers: {
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
        }
      }
    );

    console.log('Transformed image:', response.data);
  } catch (error) {
    console.error('Error:', error.response.data);
  }
}

Available API Endpoints

Image Generation APIs

/api/generate - Template-Based Image Transformation

Transform images using AI templates across all categories. Request:
{
  "image": "base64_encoded_image_data",
  "template": "Joyful Laugh",
  "templateType": "expressions"
}
Available Template Types:
  • expressions - 8 facial expression templates
  • art-styles - 6 artistic style templates
  • age-change - 4 age modification templates
  • backgrounds - 4 background replacement templates
  • effects - 6 special effect templates
  • fashion - 6 fashion style templates
  • hair-styles - 5 hairstyle templates
  • accessories - 5 accessory templates
  • seasonal - 5 seasonal theme templates
  • professional - 5 professional style templates
  • fantasy - 5 fantasy character templates
  • animals - 5 animal transformation templates
  • food - 5 food-related templates
  • travel - 5 travel-themed templates
  • sports - 5 sports activity templates
  • music - 5 music-themed templates
  • utils - 6 utility templates

/api/virtual-tryon - Virtual Try-On Generation

Apply clothing and fashion items to person images. Request:
{
  "personImage": "base64_encoded_person_image",
  "clothingImage": "base64_encoded_clothing_image",
  "settings": {
    "poseStyle": "standing",
    "lightingStyle": "studio",
    "fitPreference": "regular",
    "backgroundStyle": "plain",
    "realismLevel": "photorealistic"
  }
}

/api/product-generate - Product Photography

Generate professional product photos with AI backgrounds and styling. Request:
{
  "productImage": "base64_encoded_product_image",
  "controls": {
    "productType": "clothing",
    "stylePreset": "luxury",
    "background": "white",
    "orientation": "square",
    "marketplace": "amazon"
  }
}

/api/model-generate - AI Model Generation

Generate AI models and avatars with specific characteristics. Request:
{
  "prompt": "A 30-year-old business professional, confident smile, wearing navy suit",
  "controls": {
    "gender": "female",
    "ageGroup": "adult",
    "ethnicity": "diverse",
    "style": "professional"
  }
}

OCR APIs

/api/ocr - Text Extraction

Extract text from images with multi-language support. Request:
{
  "image": "base64_encoded_image_data",
  "language": "auto",
  "outputFormat": "text"
}
Supported Languages: English, Spanish, French, German, Italian, Portuguese, Dutch, Chinese, Japanese, Korean, Arabic, Russian, Hindi, Hebrew, Thai, Vietnamese, and more. Output Formats: text, json, csv

/api/ocr-health - OCR Health Check

Check OCR service availability and status.

User Management APIs

/api/user/profile - User Profile

Get user profile information and account details.

/api/projects - Project Management

Create, read, update, and delete user projects. Actions:
  • create - Create new project
  • list - List user projects
  • save-generation - Save generation to project

Subscription APIs

/api/subscription - Subscription Management

Manage user subscriptions and billing.

/api/subscription/check - Subscription Status

Check current subscription status and limits.

/api/subscription/payments - Payment History

Retrieve payment history and billing information.

Response Format

All API responses follow this structure:
{
  "success": true,
  "data": {
    "id": "transform_123456789",
    "status": "completed",
    "result_url": "https://cdn.nanostudio.app/results/transform_123456789.jpg",
    "template_used": "smiling",
    "processing_time": 8.5,
    "created_at": "2024-01-15T10:30:00Z"
  },
  "usage": {
    "remaining_credits": 492,
    "reset_date": "2024-02-01T00:00:00Z"
  }
}

Error Handling

The API returns standard HTTP status codes:
  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid API key)
  • 429 - Rate Limit Exceeded
  • 500 - Server Error
Error response format:
{
  "success": false,
  "error": {
    "code": "INVALID_TEMPLATE",
    "message": "The specified template is not available",
    "details": "Template 'invalid_template' not found in category 'expressions'"
  }
}
πŸš€ Ready to start? Check out our SDKs and integration guides for seamless implementation with your favorite programming language.