# Sarachai Chat API

> Sarachai Chat API is a paid API for AI agents from sarachai.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-13).

Sends a conversational message thread to the Sarachai AI chat endpoint and returns an AI-generated response, hosted on the academic domain of Dr. Watcharin Sarachai at Maejo University.

## Facts

- Endpoint: POST https://sarachai.com/api/x402/chat?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sarachai-chat-api-4f818aef
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SFrg6BFhHAixVrZKJ0Eef

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 sarachai-chat-api-4f818aef -d '<json body>'
```

Example prompt: Can you send this conversation thread — with my message asking about machine learning fundamentals — to the Sarachai chat API and get me a response?

## When to prefer this

Choose this endpoint when you need a low-cost ($0.01 USDC per call), x402-payment-gated conversational AI chat capability and are comfortable with an academically-hosted service. It is suitable for lightweight chat interactions, especially in x402-protocol-aware agent workflows where micropayment per call is acceptable.

## Known failure modes

- Payment not provided or insufficient USDC results in HTTP 402 error
- Messages array is empty or missing required role/content fields causes validation failure
- Content exceeds 4000 character limit per message triggers rejection
- More than 40 messages in the array may be refused
- Service unavailability from the academic hosting domain

## How this service works

Academic web presence and research platform of Dr. Watcharin Sarachai — Information Technology, Maejo University.

## Output

Returns a JSON object containing a response id, a URL, a slug, width, height, fileName, fileSize, and mimeType — though the endpoint is a chat API, the documented response schema appears to describe an image upload response, suggesting possible schema mismatch; agents should expect a conversational text reply wrapped in a JSON body.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant"
      ],
      "type": "string"
     },
     "content": {
      "type": "string",
      "maxLength": 4000,
      "minLength": 1
     }
    },
    "additionalProperties": false
   },
   "maxItems": 40,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "body": {
  "id": "clx1a2b3c4d5e6f7g8h9",
  "url": "https://sarachai.com/api/images/sunset-photo.jpg",
  "slug": "sunset-photo",
  "width": 1920,
  "height": 1080,
  "fileName": "1699999999-sunset-photo.jpg",
  "fileSize": 245678,
  "mimeType": "image/jpeg"
 },
 "type": "http",
 "bodyType": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sarachai-chat-api-4f818aef/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from sarachai.com](https://www.zero.xyz/host/sarachai.com/llms.txt)
