Gemini Cloud

HTTP API

Programmatic access using your platform API key. Metering and wallet deductions run on the server only.

1. Authentication

Every request must include your API key in the HTTP header (not in the URL query string).

Header

X-Api-Key: YOUR_KEY_HERE

Create a key under Client → API keys (or ask your administrator). The Google Gemini key is never sent to clients.

2. Base URL

https://gapi.akdwk.in/api/v1/

3. Endpoints

4. List models

Method: GET
URL: https://gapi.akdwk.in/api/v1/models.php

Success (200)

{
  "ok": true,
  "models": [
    {
      "model_id": "gemini-2.0-flash",
      "display_name": "Gemini 2.0 Flash",
      "supports_chat": true,
      "supports_image": true
    }
  ]
}

Errors

{ "ok": false, "error": "Missing X-Api-Key header" }

Typical status codes: 401 invalid/missing key, 403 suspended account, 405 wrong HTTP method.

5. Text generation

Method: POST
URL: https://gapi.akdwk.in/api/v1/chat.php
Content-Type: application/json

Request body (required fields)

{
  "model": "gemini-2.0-flash",
  "message": "Write a short tagline for a bakery."
}

Success (200)

{
  "ok": true,
  "text": "...",
  "model": "gemini-2.0-flash",
  "usage": {
    "deducted_inr": 0.12,
    "wallet_balance_inr": 499.88
  }
}

usage.deducted_inr is the amount subtracted from the wallet for this call. wallet_balance_inr is the balance after the call.

Errors

{ "ok": false, "error": "Wallet balance is zero. Please recharge to continue." }

Common status codes: 400 validation / model not allowed, 401 auth, 402 insufficient wallet, 403 suspended.

6. Image generation

Method: POST
URL: https://gapi.akdwk.in/api/v1/image.php
Content-Type: application/json

Request body

{
  "model": "gemini-2.0-flash",
  "prompt": "Minimal product photo of a mug on white marble."
}

Success (200)

{
  "ok": true,
  "mime": "image/png",
  "image_base64": "....",
  "model": "gemini-2.0-flash",
  "usage": {
    "deducted_inr": 0.45,
    "wallet_balance_inr": 499.55
  }
}

Errors

Same shape as chat: { "ok": false, "error": "..." }

7. Rate limits

Each API key has a requests per minute limit set when the key is created (default 60). Limits are enforced on the server per key. There is no separate hourly quota; stay within your per-minute cap.

If exceeded, you will receive an error message such as: Rate limit exceeded. Try again shortly. (HTTP 400).

8. cURL examples

List models

curl -s "https://gapi.akdwk.in/api/v1/models.php" \
  -H "X-Api-Key: YOUR_KEY_HERE"

Chat

curl -s "https://gapi.akdwk.in/api/v1/chat.php" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_KEY_HERE" \
  -d "{\"model\":\"gemini-2.0-flash\",\"message\":\"Hello\"}"

Image

curl -s "https://gapi.akdwk.in/api/v1/image.php" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_KEY_HERE" \
  -d "{\"model\":\"gemini-2.0-flash\",\"prompt\":\"A red balloon\"}"

9. Postman

Create a request, set method and URL, add header X-Api-Key, and for POST set body type raw → JSON with the examples above.