EccoAPIeccoapi

Quickstart Guide

Get up and running with EccoAPI in minutes. Follow these simple steps to make your first API call.

Prerequisites

1

Create an account at EccoAPI Dashboard

2

Generate an API key from the API Keys page

3

Ensure you have credits in your account

1. Choose your language

2. Select a model

3. Installation

python
pip install requests

4. Generate your first image

python
import requests
import time

API_KEY = "nk_live_your_api_key_here"
BASE_URL = "https://eccoapi.com/api/v1"

def generate_pro_image(prompt, aspect_ratio="16:9", image_size="4K"):
    """Generate image with NanoBanana Pro (async mode)"""
    payload = {
        "prompt": prompt,
        "aspectRatio": aspect_ratio,
        "imageSize": image_size,
        "callbackUrl": "https://your-server.com/webhook"  # optional
    }

    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }

    # Submit job (returns 202 instantly)
    response = requests.post(
        f"{BASE_URL}/api/v1/nanobananapro/generate",
        headers=headers,
        json=payload
    )

    if response.status_code != 202:
        print(f"Error: {response.json()}")
        return False

    job_id = response.json()["jobId"]
    print(f"Job submitted: {job_id}")

    # Poll for result
    while True:
        time.sleep(3)
        status_resp = requests.get(
            f"{BASE_URL}/jobs/{job_id}",
            headers={"Authorization": f"Bearer {API_KEY}"}
        )
        job = status_resp.json()

        if job["status"] == "completed":
            asset_url = job["result"]["data"]["assetUrl"]
            img = requests.get(asset_url)
            with open("generated_4k.png", "wb") as f:
                f.write(img.content)
            print(f"Image saved! Cost: $" + str(job["result"]["meta"]["cost"]))
            return True

        if job["status"] == "failed":
            print(f"Failed: {job.get('error', 'Unknown error')}")
            return False

        print(f"Status: {job['status']}...")

# Generate an image
generate_pro_image("ultra detailed mountain landscape at golden hour", "16:9", "4K")

Response Format

json
{
  "code": 200,
  "msg": "Success",
  "data": {
    "assetUrl": "https://<signed-url>",
    "assetKey": "user/<userId>/nanobananapro/2026/02/17/<uuid>.png",
    "mimeType": "image/png",
    "bytes": 2097152
  },
  "meta": {
    "model": "nanobananapro",
    "cost": 0.10,
    "remaining_credits": 9.90,
    "settings": {
      "aspectRatio": "16:9",
      "imageSize": "4K",
      "useGoogleSearch": false
    },
    "asset_url_ttl_seconds": 900,
    "asset_retention_days": 30
  }
}

Pro Tips

  • Use async mode for production — add callbackUrl to your request to avoid timeouts on longer generations. Poll /api/v1/jobs/:jobId for results.
  • Use NanoBanana Pro for high-quality 4k image generation with gemini 3 pro ($0.09-0.175/image)
  • Use NanoBanana 2 for advanced image generation with gemini 3 ($0.05-0.10/image)
  • Use GPT Image 2 for next-gen image generation powered by gpt image 2 ($0.015-0.35/image)
  • Use Kling 2.6 for high-quality video generation by kuaishou ($0.40-1.50/video)
  • Use Kling 3.0 for latest kling model with improved motion quality and visual fidelity ($0.85-2.40/video)
  • Use Seedance 2.0 for bytedance video generation with excellent motion coherence ($1.25-5.60/video)
  • Use Wan Animate for alibaba animation-focused model, optimized for stylized content ($0.65-1.90/video)
  • Use Wan 2.7 for wan video model with strong prompt adherence and scene consistency ($0.38-1.10/video)
  • Use Happy Horse for fast video generation with balanced quality and speed ($0.50-2.00/video)
  • Use Kling MC 2.6 for kling 2 ($0.25-0.75/video)
  • Use Kling MC 3.0 for kling 3 ($0.65-1.90/video)
  • Always handle 402 (insufficient credits) and 429 (rate limit) errors