{"uid":"cap_38-aYUExvGFB0NEv637f9","slug":"x402-hosting-upload-session-initializer-3fe0f5af","name":"x402-hosting Upload Session Initializer","description":"Create an upload session for a new hosted Next.js site. Call this first when deploying a new project: it returns a presigned artifact upload URL, and the paying wallet becomes the project owner.","url":"https://api.x402-hosting.com/v1/uploads","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input","output"],"properties":{"input":{"type":"object","required":["type","method","queryParams"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"headers":{"type":"object","required":["Idempotency-Key"],"properties":{"Idempotency-Key":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"}},"additionalProperties":true},"queryParams":{"type":"object","required":["name","size","sha256","contentType"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1},"size":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"contentType":{"type":"string","const":"application/zip"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type","example"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["uploadId","objectKey","uploadUrl","expiresAt","headers","operationId"],"properties":{"headers":{"type":"object","additionalProperties":{"type":"string"}},"uploadId":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},"expiresAt":{"type":"string"},"objectKey":{"type":"string"},"uploadUrl":{"type":"string"},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},"responseSchema":{"type":"json","example":{"headers":{"content-type":"application/zip"},"uploadId":"00000000-0000-4000-8000-000000000001","expiresAt":"2026-08-24T19:00:00.000Z","objectKey":"uploads/00000000-0000-4000-8000-000000000001/artifact.zip","uploadUrl":"https://uploads.example.com/artifact.zip","operationId":"00000000-0000-4000-8000-000000000001"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xO7Vg_9KgBHXK-VtOyufm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Creates an upload session for a ZIP artifact and returns a pre-signed upload URL bound to the project owner, enabling subsequent file upload for deployment.","exampleAgentPrompt":"Start an upload session on x402-hosting for my project artifact called 'my-app.zip', which is 4823040 bytes, has SHA-256 hash a3f1c2d4e5b67890abcdef1234567890abcdef1234567890abcdef1234567890ab, and is a zip file — I need the upload URL so I can push the file before deploying.","exampleUseCases":[{"title":"Agent deploys new Next.js site","prompt":"I just built my Next.js app and zipped it as 'storefront.zip' — it's 3145728 bytes with SHA-256 hash b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3. Open an upload session on x402-hosting so I can push it and get a deployment URL."},{"title":"CI pipeline pre-deployment artifact upload","prompt":"Our CI just finished building the release bundle 'release-v2.1.0.zip', it's 10485760 bytes and its checksum is 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b. Create an upload session on x402-hosting so the pipeline can push the artifact and trigger the next deployment step."},{"title":"Rapid prototype hosting for demo","prompt":"I need to get my prototype site live fast — I've got 'demo-site.zip' ready at 2097152 bytes with hash 9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e. Can you kick off an upload session on x402-hosting so I can upload it and share the live URL?"}],"resultDescription":"Returns a JSON object containing: a UUID upload session ID, a UUID operation ID for tracking, a pre-signed uploadUrl to PUT the ZIP file to, the object storage key, an expiry timestamp (ISO 8601) after which the session lapses, and any required headers to include when performing the upload.","failureModes":["Missing required query parameters (name, size, sha256, contentType) returns a 400 validation error","Invalid SHA-256 format (not 64 lowercase hex chars) causes a 400 schema rejection","contentType other than 'application/zip' is rejected with a 400 constant violation","Missing or malformed Idempotency-Key UUID header may cause duplicate session creation or a 400 error","Expired upload URL if the agent waits past the expiresAt timestamp before uploading","Payment failure via x402 (insufficient USDC balance or failed on-chain authorization) returns a 402 Payment Required"],"whenToPreferThis":"Use this endpoint as the mandatory first step when deploying a project via x402-hosting — before you can upload a ZIP build artifact or trigger a deployment, you must obtain a valid upload session and pre-signed URL from this endpoint. It is idempotent via the Idempotency-Key header, so it is safe to retry on network failure. Prefer this over any generic S3 or storage upload initiation when your target platform is x402-hosting and you intend to pay per-call in USDC via the x402 protocol.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T17:51:57.224Z","isFirstParty":false}