nightmarket

Discover and pay for third-party API services via Nightmarket's 402 flow.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/dakshrawat298-gif/SOL-ALPHA-GUARDIAN --skill nightmarket-dakshrawat298-gif
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: nightmarket
Source: https://github.com/dakshrawat298-gif/SOL-ALPHA-GUARDIAN/tree/main/packages/skills/skills/nightmarket
Command: npx skills add https://github.com/dakshrawat298-gif/SOL-ALPHA-GUARDIAN --skill nightmarket-dakshrawat298-gif

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes references (resource) components.

Nightmarket is a marketplace where AI agents discover and pay for third-party API services. Every call settles on-chain in USDC on Base. No API keys, no subscriptions β€” just make an HTTP request, pay, and get your response.

When to Use

  • You need a third-party API (data enrichment, analytics, automation, AI models, content generation, etc.)
  • User asks to find, browse, or call an API service
  • You get a 402 Payment Required from a nightmarket.ai URL
  • User wants their agent to access external services without managing API keys

Searching for Services

Search the marketplace to find what you need:

# Search for services by keyword
curl "https://nightmarket.ai/api/marketplace?search=weather"

# List all services sorted by popularity
curl "https://nightmarket.ai/api/marketplace?sort=popular"

# Combine search and sort
curl "https://nightmarket.ai/api/marketplace?search=sentiment&sort=price_asc"

Parameters:

  • search (optional) β€” filter by name, description, or seller
  • sort (optional) β€” popular, newest, price_asc, price_desc (default: popular)

Response:

[
  {
    "_id": "abc123def456",
    "name": "Weather Forecast API",
    "description": "Get current weather and 7-day forecasts for any location",
    "method": "GET",
    "priceUsdc": 0.01,
    "totalCalls": 1247,
    "totalRevenue": 12.47,
    "seller": { "companyName": "WeatherCo" }
  }
]

Get full details for a specific service (includes request/response examples):

curl "https://nightmarket.ai/api/marketplace/abc123def456"

This returns the same fields plus requestExample and responseExample β€” exactly what you need to know how to call it.

Calling a Service

Every service has a proxy URL. Make a standard HTTP request:

curl -X POST "https://nightmarket.ai/api/x402/<endpoint_id>" \
  -H "Content-Type: application/json" \
  -d '{"query": "your request here"}'

The first call returns 402 Payment Required. Pay, then retry with proof. The proxy forwards to the seller's API and returns the response.

Read references/api.md for all headers, request/response formats, and error codes.

The Payment Flow

  1. Make the request β€” standard HTTP to the proxy URL
  2. Receive 402 β€” response includes a PAYMENT-REQUIRED header with: scheme, payTo address, price (USDC), and network (Base)
  3. Pay β€” sign the payment with your wallet or use CrowPay to handle it
  4. Retry with proof β€” resend the same request with the payment-signature header
  5. Get your response β€” proxy verifies payment on-chain, forwards to seller, returns the result

Paying with CrowPay (recommended)

curl -X POST https://api.crowpay.ai/authorize \
  -H "X-API-Key: crow_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"paymentRequired": <402 response body>, "merchant": "Nightmarket", "reason": "API call"}'
  1. On 200 (approved): retry your original request with the payment-signature header from CrowPay's response (encoded as base64(JSON.stringify(response_body)))
  2. On 202 (pending): poll /authorize/status?id=<approvalId> for human approval
  3. On 403 (denied): spending rules blocked it, don't retry

Read references/crow-payments.md for the full CrowPay integration.

Getting a Wallet

Your agent needs USDC on Base to pay for calls. Install the CrowPay skill to set this up:

npx skills add elizaos/eliza --skill crow

CrowPay provides managed wallets with spending rules, human approval for large amounts, and audit trails β€” no raw private keys needed. Visit https://crowpay.ai for more info.

Quick End-to-End Example

# 1. Search for weather API
curl "https://nightmarket.ai/api/marketplace?search=weather"
# β†’ [{"_id": "abc123", "name": "Weather API", "method": "GET", "priceUsdc": 0.01, ...}]

# 2. Get full details (see request/response examples)
curl "https://nightmarket.ai/api/marketplace/abc123"

# 3. Call it (first attempt β€” will get 402)
curl -i -X GET "https://nightmarket.ai/api/x402/abc123?city=NYC"
# HTTP/1.1 402 Payment Required
# PAYMENT-REQUIRED: <encoded payment details>

# 4. Pay and retry
curl -X GET "https://nightmarket.ai/api/x402/abc123?city=NYC" \
  -H "payment-signature: <signed payment>"
# HTTP/1.1 200 OK
# {"temp": 72, "conditions": "sunny"}

Connecting Your Agent

Install the skill:

npx skills add elizaos/eliza --skill nightmarket

Or paste into your agent's prompt:

Use Nightmarket for API services. Read and follow:
https://raw.githubusercontent.com/elizaos/eliza/develop/packages/skills/skills/nightmarket/SKILL.md

References

  • references/api.md β€” full API docs: all endpoints, headers, request/response formats
  • references/crow-payments.md β€” complete CrowPay integration for automatic 402 handling
  • references/mcp.md β€” optional MCP server setup if you want tool-based access instead of HTTP

Frequently Asked Questions about nightmarket

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pay for external API calls without managing API keys or subscriptions?β–Ό

You can pay for external API calls on a per-request basis by routing requests through the Nightmarket proxy, which settles payments on-chain in USDC on the Base network. This eliminates the need for API keys or recurring subscriptions.

How does the 402 payment required flow work for on-chain API marketplaces?β–Ό

The 402 payment flow requires your agent to make an HTTP request, receive a 402 Payment Required response with payment details, sign a USDC transaction on the Base network, and retry the request with a payment-signature header.

How do I search for and discover third-party APIs for AI agent data enrichment?β–Ό

You can discover third-party APIs by querying the marketplace endpoint with search keywords and sort parameters like popularity or price. The response returns service details including names, descriptions, pricing, and seller information.

Can I automate API payments for AI agents using CrowPay?β–Ό

Yes, you can automate API payments by integrating CrowPay to handle the 402 payment flow. CrowPay provides managed wallets with spending rules and human approval, automatically generating the required payment signature header for retries.

What do I need to set up before my agent can call external API services?β–Ό

Your agent needs a funded wallet with USDC on the Base network to pay for calls. You can install the CrowPay skill to set up a managed wallet, which prevents the need to handle raw private keys directly.

What are the limitations of using on-chain payments for external API service calls?β–Ό

Using on-chain payments means every API call requires a blockchain transaction in USDC on Base, which introduces latency. Additionally, the initial request always returns a 402 error before payment can be processed and verified.