Nexus

One API. Every model.

A plain REST API over 0 models, with the same request shape for images, video, voice and music, and an OpenAI-compatible endpoint for chat.

Base URL https://nexus.promptscenes.in/api/v1

# 1. Create the task
curl https://nexus.promptscenes.in/api/v1/tasks \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "kling-4.0",
    "input": {
        "prompt": "A drone shot over a neon city at night",
        "duration": 5,
        "aspect_ratio": "16:9"
    },
    "callback_url": "https://your-app.com/webhooks/nexus"
}'

# 2. Poll for the result
curl https://nexus.promptscenes.in/api/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $NEXUS_API_KEY"
import os, time, uuid, requests

API = "https://nexus.promptscenes.in/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"}

task = requests.post(
    f"{API}/tasks",
    headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
    json={
        "model": "kling-4.0",
        "input": {
            "prompt": "A drone shot over a neon city at night",
            "duration": 5,
            "aspect_ratio": "16:9",
        },
        "callback_url": "https://your-app.com/webhooks/nexus",
    },
).json()

while task["status"] not in ("succeeded", "failed", "cancelled"):
    time.sleep(3)
    task = requests.get(f"{API}/tasks/{task['id']}", headers=HEADERS).json()

print(task["status"], task.get("output"))
const API = "https://nexus.promptscenes.in/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
  "Content-Type": "application/json",
};

let task = await fetch(`${API}/tasks`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
      "model": "kling-4.0",
      "input": {
          "prompt": "A drone shot over a neon city at night",
          "duration": 5,
          "aspect_ratio": "16:9"
      },
      "callback_url": "https://your-app.com/webhooks/nexus"
  }),
}).then((r) => r.json());

while (!["succeeded", "failed", "cancelled"].includes(task.status)) {
  await new Promise((r) => setTimeout(r, 3000));
  task = await fetch(`${API}/tasks/${task.id}`, { headers }).then((r) => r.json());
}
console.log(task.status, task.output);

The life of a request.

Generation is asynchronous, so a two-second image and a five-minute video work the same way.

  1. 1

    Submit

    POST /v1/tasks with the model and its input. The estimated maximum cost is reserved from your wallet.

  2. 2

    Get a task id

    The response returns immediately with a task id and the status queued.

  3. 3

    It runs

    The task moves through processing. Long video jobs can take minutes; nothing blocks on your side.

  4. 4

    Collect the result

    Poll GET /v1/tasks/{id}, or receive a signed webhook at your callback URL with the output.

Chat in the format you know.

Language models use the OpenAI chat completions format at /v1/chat/completions. Point your existing client at the new base URL and keep your code. Billing is per token, settled to the exact usage.

Chat completions guide
curl https://nexus.promptscenes.in/api/v1/chat/completions \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
        {
            "role": "user",
            "content": "Write a haiku about APIs."
        }
    ],
    "max_tokens": 256
}'
import os, requests

resp = requests.post(
    "https://nexus.promptscenes.in/api/v1/chat/completions",
    headers={"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"},
    json={
        "model": "claude-sonnet-5",
        "messages": [{
                "role": "user",
                "content": "Write a haiku about APIs.",
            }],
        "max_tokens": 256,
    },
    timeout=120,
)
resp.raise_for_status()
print(resp.json()["choices"][0]["message"]["content"])
const resp = await fetch("https://nexus.promptscenes.in/api/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
      "model": "claude-sonnet-5",
      "messages": [
          {
              "role": "user",
              "content": "Write a haiku about APIs."
          }
      ],
      "max_tokens": 256
  }),
});
const data = await resp.json();
console.log(data.choices[0].message.content);

Ready for production.

The details that matter once real users and real money are involved.

API keys

Create as many keys as you need. Each has scopes, a per-minute rate limit (60 by default), an optional IP allow-list and an optional daily spend cap. Keys are shown once and can be revoked instantly.

Idempotency

Send an Idempotency-Key header when creating tasks. Retrying with the same key returns the original task, so a dropped connection never charges twice.

Signed webhooks

Every webhook carries a timestamp and an HMAC-SHA256 signature of the body. Verify both and reject anything older than a few minutes.

Clear errors

Errors return a stable code and a human-readable message, so you can handle insufficient balance, rate limits and invalid input separately.

Request log

Every request appears in your dashboard with its model, status, timing and the exact charge, filterable by status.

Spend control

Set a daily limit on the whole account as well as on each key, so a bug in one service can’t empty your wallet.

Verify every webhook.

The signature header contains a Unix timestamp and an HMAC-SHA256 of timestamp.body, made with your webhook secret. Compute it yourself, compare in constant time and check the timestamp is recent.

Webhooks guide
// Header: X-Nexus-Signature: t=1733140000,v1=5f2c…
$header = $_SERVER['HTTP_X_NEXUS_SIGNATURE'] ?? '';
parse_str(str_replace(',', '&', $header), $parts);
$expected = hash_hmac('sha256', $parts['t'].'.'.file_get_contents('php://input'), $secret);

if (! hash_equals($expected, $parts['v1'] ?? '') || abs(time() - (int) $parts['t']) > 300) {
    http_response_code(400); exit;
}

Documentation.

Guides and reference, kept in step with the API.