sangtao.ai
API key

Overview

Introduction

The sangtao.ai API lets you create AI images (GPT Image), upload reference images, follow and manage jobs, publish to social networks through connected accounts, manage your media assets and characters, and list voices and background tracks. All endpoints follow REST conventions and return JSON responses.

/v2 is stable. Published field names and response shapes stay as they are; new fields may be added.

Base URL

https://api.sangtao.ai/v2

Quick start

  1. Get an API key

    Create a key on the API keys page. Copy it right away and keep it in an environment variable, never in code a browser loads.

  2. Make your first call

    Check your credit balance — read-only, costs nothing:

    bash
    curl https://api.sangtao.ai/v2/account/balance \
      -H "X-Api-Key: YOUR_API_KEY"
  3. Read the response

    json
    {
      "success": true,
      "data": {
        "freeCredit": 50,
        "purchasedCredit": 100,
        "lockedCredit": 0,
        "availableCredit": 150
      }
    }
    Every endpoint answers in the same envelope — see Response format below.

Response Format

All endpoints return a consistent JSON envelope:

JSON
// Success
{ "success": true, "data": { ... } }

// Error
{ "success": false, "error": "Error message" }

Errors

Every error answers in one JSON shape with an errorCode to branch on — the statuses and codes are on Error codes.

Rate Limits

LimitValue
Requests per minute, per API key6,000
Jobs running at once, per account20 by default — yours is in GET /account (limits)
Polling interval (recommended)3–5 seconds

The rate-limit headers and what a 429 looks like: API conventions.