API Documentation

Generate AI images programmatically.

Introduction

The Nazarte API lets you generate AI images programmatically. All requests use plain HTTP with JSON responses.

Base URL
https://nazarte.my
Sign up at /dev/login to get an API key.

Authentication

Every request must include your API key in the Authorization header:

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx

Get a key from the dashboard. The key is shown only once when generated — keep it safe.

Credits & costs

Credits are deducted when you make a request. If it fails, credits are refunded automatically.

OperationCost
Image (any model)3 credits / image

POST  Generate images

/v1/images/generations

Generate one or more images from a text prompt.

Body parameters
FieldTypeRequiredDescription
promptstringYesImage description
modelstringNoModel ID (see Models)
nintegerNoNumber of images (1-4), default 1
aspect_ratiostringNo16:9, 9:16, 1:1, 4:3
image_urlstringNoReference image
Example request
curl -X POST https://nazarte.my/v1/images/generations \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"a village at the foot of a mountain at golden hour","n":1,"aspect_ratio":"16:9"}'
Example response
{
  "created": 1775035361,
  "data": [ { "url": "https://cdn.../image-0.jpg" } ],
  "credits_charged": 3
}
Python example
import requests

API_KEY = "sk_live_xxx"
BASE = "https://nazarte.my"
h = {"Authorization": f"Bearer {API_KEY}"}

r = requests.post(f"{BASE}/v1/images/generations", headers=h, json={
    "prompt": "a cute cat sitting on a sofa", "n": 1, "aspect_ratio": "1:1",
})
print(r.json()["data"][0]["url"])

GET  Check credit balance

/v1/account/credits

curl https://nazarte.my/v1/account/credits -H "Authorization: Bearer sk_live_xxx"
{ "email": "you@email.com", "total_credits": 15 }

Available models

ModelTypeModel ID
Nano Banana ProImage7c02ef35-3a6b-4df6-b78d-873e5032c3b4
Nano Banana 2Image7418e71f-4133-4e1b-9895-bee19f48f2ce
ChatGPT 2Imagegpt-image-2

Aspect Ratio

ValueResolution
16:92752 x 1536 (Landscape)
9:161536 x 2752 (Portrait)
1:11536 x 1536 (Square)
4:32048 x 1536 (Photo)

Error handling

{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "Not enough credits." } }
HTTPCodeMeaning
401UNAUTHORIZEDAPI key missing
401INVALID_API_KEYInvalid or revoked key
402INSUFFICIENT_CREDITSNot enough credits
429RATE_LIMITEDToo many requests
502GENERATION_FAILEDFailed (credits refunded)

Limits

  • Rate limit: 30 requests / minute per API key
  • Going over returns 429 with a Retry-After header
  • Max images per request: 4
  • Max prompt length: 5000 characters