Generate AI images programmatically.
The Nazarte API lets you generate AI images programmatically. All requests use plain HTTP with JSON responses.
https://nazarte.my
/dev/login to get an API key.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 are deducted when you make a request. If it fails, credits are refunded automatically.
| Operation | Cost |
|---|---|
| Image (any model) | 3 credits / image |
/v1/images/generations
Generate one or more images from a text prompt.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Image description |
model | string | No | Model ID (see Models) |
n | integer | No | Number of images (1-4), default 1 |
aspect_ratio | string | No | 16:9, 9:16, 1:1, 4:3 |
image_url | string | No | Reference image |
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"}'{
"created": 1775035361,
"data": [ { "url": "https://cdn.../image-0.jpg" } ],
"credits_charged": 3
}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"])/v1/account/credits
curl https://nazarte.my/v1/account/credits -H "Authorization: Bearer sk_live_xxx"
{ "email": "you@email.com", "total_credits": 15 }| Model | Type | Model ID |
|---|---|---|
| Nano Banana Pro | Image | 7c02ef35-3a6b-4df6-b78d-873e5032c3b4 |
| Nano Banana 2 | Image | 7418e71f-4133-4e1b-9895-bee19f48f2ce |
| ChatGPT 2 | Image | gpt-image-2 |
| Value | Resolution |
|---|---|
16:9 | 2752 x 1536 (Landscape) |
9:16 | 1536 x 2752 (Portrait) |
1:1 | 1536 x 1536 (Square) |
4:3 | 2048 x 1536 (Photo) |
{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "Not enough credits." } }| HTTP | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | API key missing |
| 401 | INVALID_API_KEY | Invalid or revoked key |
| 402 | INSUFFICIENT_CREDITS | Not enough credits |
| 429 | RATE_LIMITED | Too many requests |
| 502 | GENERATION_FAILED | Failed (credits refunded) |
30 requests / minute per API key429 with a Retry-After header45000 characters