# API Direct – AI Mode Web Search (POST-style JSON body)

> API Direct – AI Mode Web Search (POST-style JSON body) is a paid API for AI agents from x402.apidirect.io, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-28).

Submits a conversational AI Mode prompt to a Google-powered AI search and returns an AI-generated answer with supporting sources, using a JSON body instead of query string parameters.

## Facts

- Endpoint: GET https://x402.apidirect.io/v1/web/ai-mode?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-direct-ai-mode-web-search-post-style-json-body-68ff9826
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UyFQAszVAMUnh9sImtIcu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-direct-ai-mode-web-search-post-style-json-body-68ff9826
```

Example prompt: Search Google AI Mode for 'What are the main differences between supervised and unsupervised machine learning?' in English for the US, and give me a full AI-generated answer with sources.

## When to prefer this

Choose this endpoint when you need an AI-synthesized, conversational answer from Google's AI Mode search rather than a raw list of links — especially for complex or multi-part questions where a summarized response with cited sources is more useful than organic search results. Prefer the JSON body variant (this endpoint) when constructing requests programmatically and a structured body is more convenient than URL-encoded query parameters. Use the sibling GET endpoint instead if you prefer query string parameters.

## Known failure modes

- 400 Bad Request if country or language code is not exactly 2 characters
- 400 Bad Request if prompt exceeds 12,000 characters
- 402 Payment Required if the x402 payment header is missing or invalid
- Invalid session_token causes context loss or session reset
- Prompt that violates content policy may return empty or filtered result
- Rate limiting or upstream Google AI Mode unavailability returns 5xx

## How this service works

Same behaviour as GET /v1/web/ai-mode, with the parameters sent as a JSON body instead of query string parameters.

## Output

Returns an AI-generated natural language answer synthesizing information from across the web, along with cited sources, rankings, and optionally a new session_token for continuing the conversation in subsequent calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "prompt": {
       "type": "string",
       "maxLength": 12000,
       "description": "The AI Mode prompt (max 12000 characters)"
      },
      "country": {
       "type": "string",
       "default": "us",
       "maxLength": 2,
       "minLength": 2,
       "description": "2-letter ISO 3166-1 alpha-2 country code. A value that is not exactly 2 letters is rejected with 400."
      },
      "language": {
       "type": "string",
       "default": "en",
       "maxLength": 2,
       "minLength": 2,
       "description": "2-letter ISO 639-1 language code. A value that is not exactly 2 letters is rejected with 400."
      },
      "session_token": {
       "type": "string",
       "description": "Token from a previous AI Mode response. Pass it to continue the conversation with prior context. Treat as an opaque string."
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-direct-ai-mode-web-search-post-style-json-body-68ff9826/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.apidirect.io](https://www.zero.xyz/host/x402.apidirect.io/llms.txt)
