Kerox

Máy chủ MCP từ xa để tạo hình ảnh và video bằng Kerox. Một ứng dụng khách AI như Claude Code hoặc Cursor có thể ước tính chi phí, tạo tác vụ trên một trong 25 mô hình hình ảnh/video chính thức và đọc kết quả bằng khóa API Kerox của người dùng. Endpoint: https://api.kerox.ai/mcp

Tài liệu

MCP server

Let an AI client such as Claude Code or Cursor estimate, create and read Kerox tasks with your API key, over remote MCP.

After this page your MCP client can call Kerox's tools: list models, estimate, create a task and read it. You need an API key in KEROX_API_KEY and an MCP client that supports remote servers over streamable HTTP. Creating a task through MCP is billed like any task.

Endpoint & authentication

  • URL: https://api.kerox.ai/mcp
  • Header: Authorization: Bearer <your-api-key>

Tasks created through MCP follow the same pricing and the same hold, settle and refund rules. They appear in Console → Tasks and in GET /v1/tasks with source: "mcp". A key's limits apply to MCP too (Key limits).

Add it to your client

Claude Code: one command adds the server for every project. The shell fills in your key when you run it.

# Claude Code: add the server once, for every project.
claude mcp add --transport http --scope user kerox https://api.kerox.ai/mcp \
  --header "Authorization: Bearer $KEROX_API_KEY"

A config file (Claude Code's .mcp.json in a project, or a client that reads the same mcpServers format): ${KEROX_API_KEY} is filled in from the environment when the client starts, so the key is not written in the file. If your client does not expand environment variables in this file, paste the key there instead and keep the file out of version control.

{
  "mcpServers": {
    "kerox": {
      "type": "http",
      "url": "https://api.kerox.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${KEROX_API_KEY}"
      }
    }
  }
}

Check the connection

Ask your client to call get_balance: it should answer with your balance and limits. The same call without a client, to rule the client out:

curl -sS --fail-with-body -X POST https://api.kerox.ai/mcp \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_balance", "arguments": {}}}'

The answer is one data: line with your account object. HTTP 401 means the key is missing or wrong (Errors).

A first task

On connection, the server sends workflow instructions to your MCP client. Call list_models, copy the full ID of a live model, and use get_model_schema to check its inputs. Call estimate and confirm the estimated price with the user before calling create_task with the same model and input. Poll get_task every 3 seconds while the task is processing. Stop when it is succeeded or failed.

If a model ID is unknown, the tool returns not_found. For a close match, the message suggests up to five published, live model IDs. Use list_models to check the full ID if there are no suggestions.

With Python 3 and requests, the following script reads the unified schema and estimate, submits one billable task, and saves its first output. For a reference image, set KEROX_REFERENCE_PNG to your PNG file before running. This also runs the upload, PUT and readiness check before submission.

# pip install requests
import json
import os
import time
import uuid
from pathlib import Path

import requests

api = os.environ.get("KEROX_API_ORIGIN", "https://api.kerox.ai")
auth = {"Authorization": f"Bearer {os.environ['KEROX_API_KEY']}"}

def call(name, arguments):
    response = requests.post(
        f"{api}/mcp",
        headers={**auth, "Accept": "application/json, text/event-stream"},
        json={"jsonrpc": "2.0", "id": 1, "method": "tools/call",
              "params": {"name": name, "arguments": arguments}},
        timeout=60,
    )
    response.raise_for_status()
    message = next(json.loads(line[5:]) for line in response.text.splitlines()
                   if line.startswith("data:"))
    if "error" in message:
        raise RuntimeError(message["error"])
    result = message["result"]
    value = json.loads(result["content"][0]["text"])
    if result.get("isError"):
        raise RuntimeError(value)
    return value

model = "bytedance/seedream-5.5"
schema = call("get_model_schema", {"model": model})
print(schema["unified"]["input_schema"]["properties"].keys())
inputs = {"prompt": "A watercolor of a coastal lighthouse"}
if os.environ.get("KEROX_REFERENCE_PNG"):
    path = Path(os.environ["KEROX_REFERENCE_PNG"])
    file = call("upload_file", {"filename": path.name, "size": path.stat().st_size,
                                "content_type": "image/png"})
    with path.open("rb") as data:
        requests.put(file["upload_url"], headers=file["upload_headers"],
                     data=data, timeout=300).raise_for_status()
    for _ in range(30):
        check = requests.get(f"{api}/v1/files/{file['id']}", headers=auth, timeout=30)
        check.raise_for_status()
        file = check.json()
        if file["status"] == "ready":
            break
        time.sleep(1)
    else:
        raise SystemExit("Upload did not become ready")
    inputs["images"] = [file["url"]]

args = {"model": model, "input": inputs}
estimate = call("estimate", args)
print("Estimated hold (USD):", estimate["amount"])
task = call("create_task", {**args, "idempotency_key": str(uuid.uuid4())})
task_id = task["id"]
print("TASK_ID =", task_id, flush=True)
deadline = time.monotonic() + 600
while task["status"] == "processing":
    if time.monotonic() >= deadline:
        raise SystemExit(f"Resume get_task later with id={task_id}")
    time.sleep(3)
    task = call("get_task", {"id": task_id})
if task["status"] != "succeeded":
    raise SystemExit(task["error"])
output = requests.get(task["outputs"][0]["url"], timeout=60)
output.raise_for_status()
Path("result.png").write_bytes(output.content)
print("Saved result.png")

On succeeded, outputs[0].url is the download address. On failed, read error.code. If the client stops waiting, use its printed ID with get_task to continue.

Available tools

ToolDescription
list_modelsList published image and video models with current prices
get_model_schemaInspect a model's parameters: unified.input_schema (the default format) and, for ByteDance models, the native input_schema
estimateEstimate cost for a candidate task without creating it
create_taskAfter estimating and confirming the price, submit a generation task. Returns immediately with status: "processing". Keep the id and reuse the same idempotency_key when retrying
get_taskCheck task status, outputs, cost, or error details; call it until status is succeeded or failed
list_tasksList recent tasks for your account
upload_filePrepare a reference file upload: returns upload_url and upload_headers to PUT the bytes to, and the url to use as input
get_balanceRead your balance, held amount, and limits