77trust / 100

Projects Uploads

by x402 Hosting in Documents & files

x402 APIPassing, checked 3 h ago

Create an upload session to deploy a new version of an existing project. Call this when publishing an update; it returns a presigned artifact upload URL. Only the project owner wallet can pay.

POST https://api.x402-hosting.com/v1/projects/:id/uploads

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
500 ms typical, 553 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://api.x402-hosting.com/v1/projects/:id/uploads' \
  -H 'content-type: application/json' \
  --data-raw '{"contentType":"application/zip","sha256":"0000000000000000000000000000000000000000000000000000000000000000","size":1024}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.x402-hosting.com%2Fv1%2Fprojects%2F%3Aid%2Fuploads
const res = await pay("https://api.x402-hosting.com/v1/projects/:id/uploads", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"contentType\":\"application/zip\",\"sha256\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"size\":1024}",
});
console.log(await res.json());

Example input

{
  "contentType": "application/zip",
  "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
  "size": 1024
}

Example output

{
  "expiresAt": "2026-08-24T19:00:00.000Z",
  "headers": {
    "content-type": "application/zip"
  },
  "objectKey": "uploads/00000000-0000-4000-8000-000000000001/artifact.zip",
  "operationId": "00000000-0000-4000-8000-000000000001",
  "uploadId": "00000000-0000-4000-8000-000000000001",
  "uploadUrl": "https://uploads.example.com/artifact.zip"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402508 ms$0.01
7 h agoPassed402510 ms$0.01
11 h agoPassed402553 ms$0.01
14 h agoPassed402463 ms$0.01
18 h agoPassed402495 ms$0.01
22 h agoPassed402567 ms$0.01
25 h agoPassed402545 ms$0.01
29 h agoPassed402306 ms$0.01
32 h agoPassed402500 ms$0.01
36 h agoPassed402458 ms$0.01
39 h agoPassed402544 ms$0.01
43 h agoPassed402536 ms$0.01
47 h agoPassed402471 ms$0.01
2 days agoPassed402537 ms$0.01
2 days agoPassed402387 ms$0.01