Skip to main content
Vibetool adopts an asynchronous task architecture. All heavy AI generation tasks (Image, Video, etc.) are processed as background tasks to ensure stability and efficiency.

1. Get Your API Key

1

Register Account

Visit the Vibetool Console to complete registration.
2

Create Key

Go to the API management page and click “New Key”.
3

Save Key

Copy your generated key (format: sk-or-v1-xxxxxxxxxxxxxxxx).
Treat your API key as a password. If leaked, reset it immediately.

2. Core Workflow

The integration follows a simple 3-step asynchronous pattern:

1. Submit Task

Send your request and immediately receive a unique task_id.

2. Poll Status

Use the task_id to query progress and status updates.

3. Get Results

Retrieve the final assets (URLs) once the task is completed.

3. 30-Second Experience (cURL)

Step A: Submit Image Task

curl -X POST https://api.vibetool.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "A cute cat running on the grass at sunset",
    "async_mode": true
  }'

Step B: Poll Status

# Use the 'task_id' returned from Step A
curl https://api.vibetool.ai/v1/images/status/img_20251229_xxxxxx \
  -H "Authorization: Bearer YOUR_API_KEY"

4. Quick Integration (Python)

This script automates the submission and polling process.
import requests
import time

# Use your sk-or-v1-xxx key
API_KEY = "sk-or-v1-xxxxxxxxxxxxxxxx"
BASE_URL = "https://api.vibetool.ai/v1"

def quick_generate(prompt):
    headers = {"Authorization": f"Bearer {API_KEY}"}
    
    # 1. Submit Task
    res = requests.post(f"{BASE_URL}/images/generations", headers=headers, json={
        "model": "nano-banana-pro",
        "prompt": prompt,
        "async_mode": True
    }).json()
    
    task_id = res['task_id']
    print(f"Task Created: {task_id}")

    # 2. Poll Result
    while True:
        task = requests.get(f"{BASE_URL}/images/status/{task_id}", headers=headers).json()
        status = task['status']
        print(f"Current Status: {status}")

        if status == 'completed':
            print(f"Success! URL: {task['images'][0]['url']}")
            break
        elif status == 'failed':
            print(f"Task failed: {task.get('error')}")
            break
        
        time.sleep(5) # Wait 5 seconds before polling again

quick_generate("A futuristic intelligent city")

Best Practices

Error Handling

Always check for 429 (Rate Limit) and 402 (Insufficient Balance) status codes.

Secure Storage

Use environment variables for API keys. Never hardcode them in your client-side code.