Skip to content

Web and Gemini Overview ​

Web and Gemini-compatible capabilities cover web search, web reading and Gemini format content generation. They are suitable for applications that require web information, body extracts, text understanding or Gemini compatible access.

Route List ​

MethodologyPathPurpose
POST/v1/web-search/searchWeb search.
POST/v1/web-reader/readRead the page.
POST/v1beta/models/{model}:generateContentGemini media understand.
POST/v1beta/models/{modelName}:generateContentGenerates in Gemini format.

Web Search ​

bash
curl https://moonnexai.com/v1/web-search/search \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "MoonNexAI API documentation",
    "area": "global",
    "count": 10,
    "format": "json"
  }'

Web Read ​

bash
curl https://moonnexai.com/v1/web-reader/read \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/article",
    "format": "md",
    "liteMode": true,
    "includeImages": true
  }'

Gemini-compatible ​

bash
curl https://moonnexai.com/v1beta/models/gemini-compatible:generateContent \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "写一段简短的产品介绍。"
          }
        ]
      }
    ]
  }'

Use recommendations ​

  • The search for API is suitable for candidate pages and abstracts, and the reading of API is suitable for extracting the main text of the specified web page.
  • When the same page is processed on several occasions, it is recommended that the reading results be Cacheed.
  • The model name in the Gemini-compatible path should be consistent with the model available in the MoonNexAI console.
  • Pictures, PDF, audio or video input suggest that the file be kept in size to avoid an oversized request.

Relevant Pages ​