Skip to content
VenturePrice List

SKYLATHE docs — MCP, CLI, webhooks, SDK

Connect SKYLATHE to any AI chat, script or server. Every paid call shows its exact price first, spends only up to the ceiling you set, needs an approval and refunds what was not delivered.

The reference below is in English (tool names, fields and code).

Use SKYLATHE inside your AI chat

Connect over MCP

# Claude Code (OAuth opens in the browser; contract 2 on every call)
claude mcp add --transport http skylathe https://skylatheai.com/api/mcp

# Any MCP client (Streamable HTTP) — JSON config
{ "mcpServers": { "skylathe": { "type": "http", "url": "https://skylatheai.com/api/mcp" } } }

# Server-to-server with a member key (contract 1 unless you send the header)
curl -s https://skylatheai.com/api/mcp -H "Authorization: Bearer $SKYLATHE_API_KEY" -H "x-skylathe-contract: 2" \
  -H "content-type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# The versioned manifest (classes, versions, input + output schemas, live proof) — public
curl -s https://skylatheai.com/api/mcp/manifest

Tools and their side-effect classes

24 tools, 0 live-verified

ToolClassVersionPaidProof
modelsREAD2.0.0noRE-TEST DUE
pricePLAN2.0.0noRE-TEST DUE
generateGENERATE2.1.0yesRE-TEST DUE
jobREAD2.1.0noRE-TEST DUE
job_cancelWRITE2.1.0noRE-TEST DUE
jobsREAD2.0.0noRE-TEST DUE
assetsREAD2.0.0noRE-TEST DUE
assetREAD2.0.0noRE-TEST DUE
balanceREAD2.0.0noRE-TEST DUE
searchREAD2.0.0noRE-TEST DUE
fetchREAD2.0.0noRE-TEST DUE
planPLAN2.0.0noRE-TEST DUE
ad_studioPLAN2.0.0noRE-TEST DUE
influencer_studioPLAN2.0.0noRE-TEST DUE
workflowsREAD2.0.0noRE-TEST DUE
workflow_runGENERATE2.1.0yesRE-TEST DUE
workflow_statusREAD2.0.0noRE-TEST DUE
identity_saveWRITE2.1.0noRE-TEST DUE
identity_getREAD2.0.0noRE-TEST DUE
identity_checkREAD2.0.0noRE-TEST DUE
analyzePLAN2.0.0noRE-TEST DUE
editGENERATE2.1.0yesRE-TEST DUE
projectsREAD2.0.0noRE-TEST DUE
project_addWRITE2.1.0noRE-TEST DUE

Contract 2: dry run, ceiling, approval, idempotency

// 1 · dry run: the exact price + an approval token for exactly these arguments (nothing charged)
{"method":"tools/call","params":{"name":"generate","arguments":{"model":"nano-banana-2","prompt":"a red apple","dry_run":true}}}
// → {"dry_run":true,"credits":16,"charged":0,"approval_token":"sat1.…","expires_at":"…"}

// 2 · show "16 credits" to the person; on yes:
{"method":"tools/call","params":{"name":"generate","arguments":{"model":"nano-banana-2","prompt":"a red apple",
  "approval_token":"sat1.…","max_credits":16,"idempotency_key":"order-7f3a91c2"}}}
// → {"job_id":"…","status":"queued","credits_charged":16}

// a retry with the same idempotency_key returns the same job and charges 0
// refused before any credit: idempotency_required · max_credits_required · approval_required ·
//   approval_invalid · over_max_credits · price_changed (structuredContent.error.class)

Approve an agent

Make a signed approval an AI agent can pass as approval_token: the classes it may run, the most one call may spend, and for how long (up to 24 hours). Only you can make one, signed in here — never with a key.

Classes

Command line

npm install -g skylathe          # once the package is published
export SKYLATHE_API_KEY=ck_…
skylathe dry-run  --model nano-banana-2 --prompt "a red apple"
skylathe generate --model nano-banana-2 --prompt "a red apple" --max-credits 20
skylathe status <job_id>
skylathe download <asset_id> --out apple.webp

Webhooks

import { createHmac, timingSafeEqual } from "node:crypto";

// header  Skylathe-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>
export function verify(secret: string, rawBody: string, header: string | null, toleranceSec = 300): boolean {
  if (!header) return false;
  const p = Object.fromEntries(header.split(",").map(x => x.trim().split("=")));
  const t = Number(p.t);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
  const expected = Buffer.from(createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
  const given = Buffer.from(String(p.v1 ?? ""));
  return expected.length === given.length && timingSafeEqual(expected, given);
}
// events: job.completed · job.failed · job.refunded — body {id, type, created_at, data:{job_id, status, credits_reserved, credits_refunded, refund_reason}}
import hmac, hashlib, time
from typing import Optional

def verify(secret: str, raw_body: bytes, header: Optional[str], tolerance: int = 300) -> bool:
    if not header:
        return False
    p = dict(x.strip().split("=", 1) for x in header.split(","))
    try:
        t = int(p["t"])
    except (KeyError, ValueError):
        return False
    if abs(time.time() - t) > tolerance:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, p.get("v1", ""))

SDK examples

// TypeScript (Node 18+): the CLI package doubles as a small client library
import { istemci } from "skylathe";

const c = istemci({ anahtar: process.env.SKYLATHE_API_KEY });
const { teklif, sonuc } = await c.uret(
  { model: "nano-banana-2", prompt: "a red apple on a table" },
  { enCok: 20, onay: async (q) => q.credits <= 20 },   // your approval rule (or ask a person)
);
console.log(teklif.credits, sonuc?.job_id);
console.log(await c.is(sonuc!.job_id));                 // status + receipt
# Python 3.9+ — plain JSON-RPC over HTTPS, contract 2
import json, os, uuid, urllib.request

URL = "https://skylatheai.com/api/mcp"
HEAD = {"authorization": f"Bearer {os.environ['SKYLATHE_API_KEY']}", "content-type": "application/json", "x-skylathe-contract": "2"}

def call(name, args):
    body = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": name, "arguments": args}}).encode()
    res = json.load(urllib.request.urlopen(urllib.request.Request(URL, body, HEAD)))["result"]
    if res.get("isError"):
        raise RuntimeError(res["structuredContent"]["error"])
    return res.get("structuredContent") or json.loads(res["content"][0]["text"])

order = {"model": "nano-banana-2", "prompt": "a red apple on a table"}
quote = call("generate", {**order, "dry_run": True})
print("exact price:", quote["credits"], "credits")
job = call("generate", {**order, "approval_token": quote["approval_token"], "max_credits": quote["credits"], "idempotency_key": str(uuid.uuid4())})
print(call("job", {"job_id": job["job_id"]}))

Error classes

ClassMeaning
invalid_argumentsThe arguments do not fit the tool's input schema or its rules.
unauthenticatedNo member key or OAuth token, or it is not valid.
insufficient_scopeThe OAuth connection was not allowed this scope.
daily_ceilingThe connection's daily credit ceiling would be passed.
monthly_ceilingThe connection's monthly credit ceiling would be passed.
over_max_creditsThe exact price is above the call's max_credits.
price_changedThe price is above the one quoted (expected_credits or the approval token).
idempotency_requiredContract 2: a paid call needs idempotency_key.
max_credits_requiredContract 2: a paid call needs max_credits.
approval_requiredContract 2: a GENERATE, WRITE or PUBLISH call needs approval_token.
approval_invalidThe approval token is expired, for another call, another member or another class.
no_priceThe setting is not measured, so it is not sold.
content_refusedThe content rule refused the request.
rate_limitedToo many calls in a short time (see Retry-After).
producer_unavailableThe model's maker is switched off or unreachable; nothing was charged.
not_foundNo such job, asset, identity or run among yours.
already_closedThe job is already closed.
internalAn unexpected fault on our side; it is logged.

Skills for Claude Code

claude plugin marketplace add <owner>/skylathe-skills   # after the repository is published
claude plugin install skylathe@skylathe
# skills: safe-spend · job-status · product-shot · ad-pack · story-series · identity-dna · refund-dispute · export-assets

Explore more of SKYLATHE