{"uid":"cap_Uoe55gFlq1oFk5kJi7CS3","slug":"x402-hosting-upload-session-initializer-5a5b2378","name":"x402-hosting Upload Session Initializer","description":"Prepaid full-stack Next.js hosting operated by agents. One CLI command builds and deploys your app to a production URL; pay per project-day in USDC over the x402 protocol. No account, no dashboard.","url":"https://api.x402-hosting.com/v1/projects/%7Bid%7D/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},"pathParams":{"type":"object","required":["id"],"properties":{"id":{"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},"queryParams":{"type":"object","required":["size","sha256","contentType"],"properties":{"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_8RdU7jvvDVW1IZDkztKhy","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 a pre-signed upload session for a Next.js project ZIP file, returning a URL and metadata needed to upload the build artifact for deployment.","exampleAgentPrompt":"Upload my Next.js build ZIP to x402-hosting for project ID a1b2c3d4-e5f6-4789-ab01-cdef01234567 — the ZIP is 4200000 bytes, its SHA-256 hash is 3a7bd3e2360a3d29aa625b9643ddaad2c2d5c3f5e7b1e9f0a4c6d8e2f1b0c9d8, and I'm ready to pay with USDC.","exampleUseCases":[{"title":"CI/CD pipeline artifact push","prompt":"My GitHub Actions build just finished and I need to upload the resulting Next.js ZIP to x402-hosting for project 00000000-0000-4000-8000-000000000002 — the file is 8500000 bytes with SHA-256 hash 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b, can you get me the upload URL?"},{"title":"Agent-driven site deployment","prompt":"Deploy my latest Next.js marketing site to x402-hosting — the compiled ZIP for project b3c4d5e6-f7a8-4901-bcde-f01234567890 is 2100000 bytes and has SHA-256 hash 9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e, start the upload session."},{"title":"Manual re-deploy after hotfix","prompt":"I patched a bug and rebuilt my Next.js app — please start an upload session on x402-hosting for project c4d5e6f7-a8b9-4012-cdef-012345678901, the new ZIP is 3750000 bytes with hash 2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c so I can push it and get the live URL."}],"resultDescription":"Returns a JSON object containing a pre-signed uploadUrl for direct PUT of the ZIP, an uploadId and operationId (both UUIDs) to track the upload, an objectKey representing the storage path, an expiresAt timestamp after which the URL is invalid, and any required request headers (e.g. Content-Type) to include when uploading.","failureModes":["Invalid project UUID in path returns 404 or 400","SHA-256 hash mismatch or wrong format returns 422 validation error","Unsupported content type (anything other than application/zip) returns 400","Missing or malformed Idempotency-Key header returns 400","File size of 0 or negative returns 400","x402 payment not completed or insufficient USDC balance returns 402 Payment Required","Expired or reused upload URL after expiresAt results in upload rejection downstream","Project not found or unauthorized access returns 403"],"whenToPreferThis":"Use this endpoint when you need to deploy or update a Next.js project on x402-hosting and must first stage the build artifact before triggering deployment. This is the required first step in the upload-then-deploy flow — prefer it over alternatives when you need prepaid, USDC-based hosting with x402 protocol support and want a simple one-command deployment loop for AI agents.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-09T12:30:05.110Z","isFirstParty":false}