{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentNASA x402 API",
    "version": "1.0.0",
    "description": "NASA data APIs with x402 micropayment access. Near Earth Objects, Space Weather (DONKI), and Astronomy Picture of the Day.",
    "contact": {
      "name": "Ocean Digital Group",
      "url": "https://memoryapi.org",
      "email": "dmski100@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://nasa.memoryapi.org",
      "description": "Production"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health check",
        "operationId": "health",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "service": {
                      "type": "string"
                    },
                    "port": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/x402/nasa/neo": {
      "get": {
        "summary": "Near Earth Objects (Asteroids)",
        "operationId": "getNearEarthObjects",
        "description": "NASA NeoWs asteroid tracking data. Requires x402 micropayment of $0.001 USDC.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Start date YYYY-MM-DD (default: today)",
            "schema": {
              "type": "string",
              "example": "2026-05-29"
            }
          },
          {
            "name": "days",
            "in": "query",
            "description": "Number of days (1-7, default: 3)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7,
              "default": 3
            }
          },
          {
            "name": "hazardous_only",
            "in": "query",
            "description": "Only potentially hazardous asteroids",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asteroid data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string"
                        },
                        "end": {
                          "type": "string"
                        },
                        "days": {
                          "type": "integer"
                        }
                      }
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "hazardous_count": {
                      "type": "integer"
                    },
                    "asteroids": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC micropayment needed"
          }
        }
      }
    },
    "/x402/nasa/donki": {
      "get": {
        "summary": "Space Weather (DONKI)",
        "operationId": "getSpaceWeather",
        "description": "NASA DONKI space weather events. Requires x402 micropayment of $0.001 USDC.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Event type: solar_flare, cme, geomagnetic_storm, or all",
            "schema": {
              "type": "string",
              "enum": [
                "solar_flare",
                "cme",
                "geomagnetic_storm",
                "all"
              ],
              "default": "all"
            }
          },
          {
            "name": "days",
            "in": "query",
            "description": "Days to look back (1-30, default: 7)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Space weather events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "period_days": {
                      "type": "integer"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "solar_flares": {
                          "type": "integer"
                        },
                        "cmes": {
                          "type": "integer"
                        },
                        "storms": {
                          "type": "integer"
                        }
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC micropayment needed"
          }
        }
      }
    },
    "/x402/nasa/apod": {
      "get": {
        "summary": "Astronomy Picture of the Day",
        "operationId": "getAPOD",
        "description": "NASA Astronomy Picture of the Day. Requires x402 micropayment of $0.001 USDC.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Date YYYY-MM-DD (default: today)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Number of random pictures (1-10, overrides date)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            }
          },
          {
            "name": "thumbs",
            "in": "query",
            "description": "Include video thumbnail URLs",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "APOD data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "date": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "explanation": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "hdurl": {
                      "type": "string"
                    },
                    "media_type": {
                      "type": "string"
                    },
                    "copyright": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC micropayment needed"
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "summary": "MCP server info",
        "operationId": "mcpInfo",
        "security": [],
        "responses": {
          "200": {
            "description": "MCP server metadata"
          }
        }
      },
      "post": {
        "summary": "MCP tool calls",
        "operationId": "mcpCall",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  },
                  "id": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response"
          }
        }
      }
    }
  }
}