Tao-Source API Documentation

Welcome to the Tao-Source API! Our RESTful API provides access to state-of-the-art generative AI models for image and video generation.

Base URL

https://api.tao-source.com/v1

Features

  • • High-quality image generation
  • • Video synthesis capabilities
  • • Custom model training
  • • Real-time inference
  • • Scalable infrastructure

Getting Started

  1. 1. Sign up for an API key
  2. 2. Read the authentication guide
  3. 3. Make your first API call
  4. 4. Explore advanced features

Authentication

All API requests require authentication using Bearer tokens. Include your API key in the Authorization header.

Request Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
⚠️ Security Note

Keep your API key secure and never expose it in client-side code. Use environment variables in production.

API Endpoints

Image Generation

POST /generate/image

Request Body

{
  "prompt": "A beautiful sunset over mountains",
  "model": "sdxl-1.0",
  "size": "1024x1024",
  "style": "photorealistic",
  "steps": 30,
  "guidance_scale": 7.5,
  "seed": 42
}

Parameters

Parameter Type Required Description
prompt string Yes Text description of the image
model string No Model to use (default: sdxl-1.0)
size string No Image dimensions (default: 1024x1024)
steps integer No Number of inference steps (10-50)

Response

{
  "id": "img_abc123",
  "status": "completed",
  "created_at": "2024-01-15T10:30:00Z",
  "prompt": "A beautiful sunset over mountains",
  "url": "https://cdn.tao-source.com/images/abc123.jpg",
  "generation_time": 2.34,
  "model": "sdxl-1.0",
  "parameters": {
    "size": "1024x1024",
    "steps": 30,
    "guidance_scale": 7.5,
    "seed": 42
  }
}

Video Generation

POST /generate/video

Request Body

{
  "prompt": "A cat walking through a garden",
  "duration": 5,
  "fps": 24,
  "resolution": "1080p",
  "model": "sora-v1"
}

Response

{
  "id": "vid_xyz789",
  "status": "processing",
  "created_at": "2024-01-15T10:30:00Z",
  "estimated_completion": "2024-01-15T10:32:00Z",
  "prompt": "A cat walking through a garden",
  "webhook_url": null
}

Custom Model Training

POST /training/create

Start a custom model training job with your own dataset. Training typically takes 2-6 hours depending on dataset size.

💡 Enterprise Feature

Custom model training requires an Enterprise plan. Contact our sales team for more information.

Code Examples

Python

import requests

def generate_image(prompt):
    url = "https://api.tao-source.com/v1/generate/image"
    
    headers = {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    data = {
        "prompt": prompt,
        "model": "sdxl-1.0",
        "size": "1024x1024"
    }
    
    response = requests.post(url, headers=headers, json=data)
    return response.json()

# Usage
result = generate_image("A futuristic cityscape")
print(result["url"])

JavaScript

async function generateImage(prompt) {
  const response = await fetch('https://api.tao-source.com/v1/generate/image', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      prompt: prompt,
      model: 'sdxl-1.0',
      size: '1024x1024'
    })
  });
  
  return await response.json();
}

// Usage
generateImage('A futuristic cityscape')
  .then(result => console.log(result.url));

Pricing

Starter

$0.02
per image
  • • Up to 1,000 images/month
  • • Standard resolution
  • • Email support

Professional

$0.015
per image
  • • Up to 10,000 images/month
  • • High resolution
  • • Video generation (beta)
  • • Priority support

Enterprise

Custom
pricing
  • • Unlimited usage
  • • Custom model training
  • • Private deployment
  • • Dedicated support

Rate Limits

Default Limits

  • Image Generation: 100 requests/minute
  • Video Generation: 10 requests/minute
  • Model Training: 1 request/hour

Rate Limit Headers

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1642234567

Support

Get Help