One POST to generate. Billed in rupees.
Submit a job, poll for the result. No GPU to provision, no cold start to manage, no minimum spend — and no charge at all for a generation that fails.
Read this first: the API is asynchronous
GHive runs on consumer GPUs in Indian homes and offices, not a datacentre. Submitting returns immediately with a job id, and a result typically lands within seconds — but there is a queue, and at busy times it can be longer. If you need a guaranteed sub-second synchronous endpoint, we are honestly not the right choice yet. If you are doing batch or background work and care about price, we are hard to beat.
Authentication
Every request carries a bearer token. Create keys on your API keys page. A key is shown once and stored only as a hash — if you lose it, revoke it and make another.
Authorization: Bearer ghk_live_xxxxxxxxxxxxxxxxxxxxModels and prices
You are charged a flat price per output, taken from your GHive wallet when the result exists — never for a job that fails, and never for a retry.
| model (tier) | What it is | Typical | Price |
|---|---|---|---|
| fast | Quick and affordable. | ~2s | ₹2.00 |
| standard | Great quality and speed. | ~5s | ₹3.00 |
| best | Maximum detail. Takes a little longer. | ~15s | ₹5.00 |
| upscale | Make an image you already generated bigger and sharper. | ~4s | ₹2.00 |
| video3 | Short clip · 3 seconds. | ~870s | ₹42.00 |
| video5 | Better motion · 5 seconds. | ~1400s | ₹76.00 |
| video-upscale | Make a clip you already generated twice the size and sharper. | ~180s | ₹17.00 |
A tier is a contract about the OUTCOME, not about which checkpoint runs. Which weights serve it depends on the GPU that picks your job up — a bigger machine may use a better model for the same tier at the same price. We add tiers; we never repoint an existing one at a worse outcome.
This is deliberate: naming a checkpoint would mean your request failing whenever the one machine holding it went offline.
POST /api/v1/generate
curl https://ghive.co.in/api/v1/generate \
-H "Authorization: Bearer $GHIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "standard",
"prompt": "a street food stall at night in Bengaluru, warm lights, rain"
}'Responds 202 immediately:
{
"id": "job_9f3c...",
"status": "queued",
"model": "standard",
"price_paise": 200,
"poll_url": "/api/v1/jobs/job_9f3c..."
}| Field | Type | Notes |
|---|---|---|
| model | string, required | One of the tier ids above. |
| prompt | string, required | Up to 2000 characters. |
| negative_prompt | string | What to steer away from. |
| seed | integer | Pin it for reproducible output. |
| source_job_id | string | Required for upscale and video-upscale — an earlier job of yours whose output is the input. It must be the same kind of output as the tier produces: a still for upscale, a clip for video-upscale. |
| upload_id | string | Start from a picture instead of from the prompt alone — restyled on the image tiers, animated on the video ones. Accepted by fast, standard, best, video3 and video5. POST the file as multipart file to /api/uploads first — PNG, JPEG or WebP, up to 12MB — and pass the id it returns. The picture becomes the starting point and promptdescribes the change. Uploads are deleted six hours after they are made. |
GET /api/v1/jobs/{id}
curl https://ghive.co.in/api/v1/jobs/job_9f3c... \
-H "Authorization: Bearer $GHIVE_API_KEY"
{
"id": "job_9f3c...",
"status": "done",
"model": "standard",
"price_paise": 200,
"billed_paise": 200,
"output_url": "/api/v1/jobs/job_9f3c.../output",
"deleted": false,
"error": null
}status is one of queued, assigned, running, done, failed. Poll every couple of seconds. Fetch output_url with the same bearer token to get the PNG.
Downloading and deleting
Add ?download=1 to output_url and the response comes back as a file attachment instead of an inline image. Same bytes, same auth — only the Content-Disposition changes.
DELETE /api/v1/jobs/{id} removes our copy of the image. It is permanent and there is no undo, so fetch it first if you want it.
# Save it, then delete our copy.
curl "https://ghive.co.in/api/v1/jobs/job_9f3c.../output?download=1" -H "Authorization: Bearer $GHIVE_API_KEY" -o out.png
curl -X DELETE https://ghive.co.in/api/v1/jobs/job_9f3c... -H "Authorization: Bearer $GHIVE_API_KEY"
{ "id": "job_9f3c...", "deleted": true }The job record survives — it is the receipt for what you were charged, and deleting an image must not erase your billing history. Polling a deleted job still works and returns "deleted": true with a null output_url, which is how you tell "I deleted this" from "it never produced an image".
We keep only your most recent 9 images. Generating a new one removes the oldest — its output_url stops resolving and polling it returns "deleted": true. Fetch anything you need as soon as the job is done; this is not storage.
End to end, in Python
import os, time, requests
BASE = "https://ghive.co.in"
H = {"Authorization": f"Bearer {os.environ['GHIVE_API_KEY']}"}
job = requests.post(
f"{BASE}/api/v1/generate",
headers=H,
json={"model": "standard", "prompt": "a red vintage scooter on a Goa beach"},
).json()
while True:
status = requests.get(f"{BASE}{job['poll_url']}", headers=H).json()
if status["status"] in ("done", "failed"):
break
time.sleep(2)
if status["status"] == "done":
img = requests.get(f"{BASE}{status['output_url']}", headers=H)
open("out.png", "wb").write(img.content)Errors
Every failure returns { "error": { "type", "message" } }. Branch on type, show message.
| HTTP | type | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key. |
| 400 | invalid_request | A field is missing or malformed. |
| 400 | unknown_model | The model name isn't one we serve. The message lists what is. |
| 402 | insufficient_balance | Your wallet can't cover this job. Top up and retry. |
| 404 | not_found | No such job, or it belongs to another account. |
| 429 | rate_limited | Too many requests. Back off and retry. |
Generating more than a few an hour?
Somewhere around 15-30 standard images an hour — it depends on the card — renting a GPU outright becomes cheaper than paying per image. We would rather tell you that than quietly overcharge you.
Generated with openly licensed AI models. Powered by Stability AI.