AI For Thai API

Machine Learning / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

AI For Thai is a free collection of AI-powered APIs specifically designed for the Thai language, covering NLP tasks like word segmentation, sentiment analysis, and text-to-speech. It is built to address the unique challenges of processing Thai text, which has no spaces between words. An API key from the NECTEC research institute is required to access the service.

Beginner Tip

Thai text processing requires special tokenization because Thai words are not separated by spaces—always send raw Thai text and let the API handle segmentation. Register at aiforthai.in.th with a Thai ID or institutional account to receive your API key.

Available Data

Use case: Integrate free various thai ai api data into web and mobile applications
AI For Thai data via REST API

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from AI For Thai",
    "description": "Free Various Thai AI API",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

tokens List of word tokens resulting from Thai word segmentation.
tokens[].data The individual Thai word extracted by the tokenizer.
tokens[].type Token type such as WORD, PUNCT, or SPACE.

Implementation Example

Request
const url = "https://aiforthai.in.th/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing or incorrect API key in the request header.
Include the apikey header with your NECTEC-issued API key in every request.
Incorrect segmentation Input text contains mixed Thai and English without proper formatting.
Send clean Thai-only text for word segmentation; preprocess to remove HTML tags or special characters first.
Connection timeout The server may be under maintenance or experiencing high load.
Retry after a short delay; check the AI For Thai website for service status announcements.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Machine Learning
Difficulty Intermediate
Verified: 2026-04-04

Related Tags

Similar APIs

View All →