Skip to content

melyx-id/aigatecloud-api-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

AIGate API Examples

One API for All AI — smart routing, shared asset library, cost optimization.

This repo uses a placeholder token. The examples will return 401 Unauthorized until you replace YOUR_KEY_HERE with a real key.

👉 Register free at aigatecloud.com — get 100 free credits on the T0 plan. No credit card required.


Quick Start

# 1. Clone
git clone https://github.com/aigatecloud/api-examples.git
cd api-examples

# 2. Copy env file
cp .env.example .env

# 3. Add your real key (get one free at aigatecloud.com)
#    Edit .env → replace sk-aigate-YOUR_KEY_HERE

# 4. Run an example
php examples/generate-image.php

Base URL

https://api.aigatecloud.com/v1/

All requests require:

Authorization: Bearer sk-aigate-YOUR_KEY_HERE
Content-Type: application/json

Endpoints (T0 Free Plan)

Endpoint Method Credits Description
/v1/search GET 0 Search asset library
/v1/generate/image POST 10 Generate or fetch image
/v1/me GET 0 Account info & credit balance

Video generation (/v1/generate/video, 100 credits) requires Starter plan or above.

BYOK (bring your own OpenAI/Runway/etc. key) requires Scale plan.


Credit Costs

Action Credits
Generate / fetch image 10
Generate / fetch video 100
Search library 0
Check balance (/me) 0

Credits never expire. Top up any time at aigatecloud.com.


Plans

Plan Price Credits Video
Free $0 100
Starter $9 one-time 1,200
Creator ⭐ $29 one-time 4,000
Pro $79 one-time 12,000 ✓ + webhooks
Scale $199 one-time 35,000 ✓ + BYOK

Examples in This Repo


Response Format

All responses are JSON:

{
  "ok": true,
  "source": "library",
  "provider": "pexels",
  "credits_charged": 10,
  "credits_balance": 90,
  "asset": {
    "id": 1042,
    "url": "https://cdn.aigatecloud.com/assets/img_9x16_luxury_a41f.jpg",
    "thumbnail_url": "https://cdn.aigatecloud.com/assets/thumb/img_9x16_luxury_a41f.jpg",
    "aspect_ratio": "9:16",
    "use_case": "viral_background",
    "tags": ["luxury", "gold", "lifestyle"],
    "width": 1080,
    "height": 1920
  }
}

Error responses:

{ "ok": false, "error": "Insufficient credits. Purchase more at aigatecloud.com", "code": 429 }

License

MIT — free to use in commercial projects. Attribution appreciated but not required.

Built by the Melyx ecosystem.

About

Code examples for the AIGate API — image & video generation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors