{"message":"👋 Welcome to the x402 Marketplace API Gateway.","description":"Instant pay-per-use access to top APIs using the x402 protocol — starting with OpenAI.","status":"online","version":"1.0.0","payment_instructions":{"overview":"Every request is pay-per-use. Your first call collects a 402 challenge, then you retry with an X-PAYMENT header that proves settlement on Solana.","gateway_wallet":"9rKmtdWDHGmi3xqyvTM23Bps5wUwg2oB7Y9HAseRrxqv","initial_call":{"description":"Send the request without an X-PAYMENT header to obtain pricing and payment requirements. You will receive HTTP 402 with the structured challenge payload.","example_curl":"curl -i https://x402market.app/openai/chat/completions   -H 'Content-Type: application/json'   -H 'x402-sender-wallet: <YOUR_SOLANA_ADDRESS>'   -d '{ \"model\": \"gpt-4o-mini\", \"messages\": [{ \"role\": \"user\", \"content\": \"say hello\" }] }'"},"payment_challenge":{"description":"The 402 response body contains PaymentRequirements. Persist it — you must echo these exact fields when constructing the second attempt.","example_402_response":{"status":402,"body":{"x402Version":1,"error":"X-PAYMENT header is required","accepts":[{"network":"solana","scheme":"exact","payTo":"9rKmtdWDHGmi3xqyvTM23Bps5wUwg2oB7Y9HAseRrxqv","amountUsd":"<calculated>","memo":"<opaque session identifier>"}]}}},"second_attempt":{"description":"Create a signer for your Solana wallet, pay the stated amount, encode the signed payment JSON as base64, and retry the identical request with the X-PAYMENT header.","headers_required":["x402-sender-wallet","X-PAYMENT"],"curl_example":"curl -i https://x402market.app/openai/chat/completions   -H 'Content-Type: application/json'   -H 'x402-sender-wallet: <YOUR_SOLANA_ADDRESS>'   -H 'X-PAYMENT: <BASE64_PAYMENT_HEADER>'   -d '{ \"model\": \"gpt-4o-mini\", \"messages\": [{ \"role\": \"user\", \"content\": \"say hello\" }] }'","node_example":["import { createSigner } from \"x402/types\";","import { createPaymentHeader } from \"x402/client\";","","const signer = await createSigner(\"solana\", process.env.SVM_PRIVATE_KEY!);","const header = await createPaymentHeader(signer, 1, paymentRequirements);","const response = await fetch(\"https://x402market.app/openai/chat/completions\", {","  method: \"POST\",","  headers: {","    \"content-type\": \"application/json\",","    \"x402-sender-wallet\": signer.address,","    \"X-PAYMENT\": header,","  },","  body: JSON.stringify(payload),","});"],"payment_payload_template":{"paymentPayload":"<Signed payment payload from your facilitator>","paymentRequirements":"<Exact object returned in the initial 402 response>"}},"tips":["Ensure the wallet that signs the payment matches the `x402-sender-wallet` header.","Reuse the payment receipt for additional calls until the credited balance is exhausted.","Always base64-encode the full JSON envelope when setting the `X-PAYMENT` header."]},"available_endpoints":{"openai_completions":"/openai/completions","openai_chat_completions":"/openai/chat/completions","openai_images":"/openai/images/generations","openai_models":"/openai/models"},"disclaimer":"x402 Marketplace acts as a payment-gated proxy layer for third-party APIs. Payments are verified on-chain and non-refundable."}