canonical: https://jentic.com/apis/aiforthai.in.th/aiforthai

# Aiforthai In Th AI For Thai API

Jentic publishes the only available OpenAPI specification for AI For Thai API, keeping it validated and agent-ready. AI For Thai is a suite of Thai-language AI services developed by NECTEC, the National Electronics and Computer Technology Center of Thailand. The API covers text processing (summarisation, word tokenisation, part-of-speech tagging, named-entity recognition, sentiment), speech (Thai speech-to-text and text-to-speech), translation to and from Thai, and image processing (object detection and OCR for Thai script). Authentication uses an API key sent in the Apikey header.

## For AI agents

Run Thai-language NLP, speech, translation, and image processing - summarisation, tokenisation, NER, sentiment, STT, TTS, translation, object detection, and Thai OCR.

## Scope

Does not handle non-Thai language analysis as a primary use case, payment processing, or general business workflow - use for Thai-language NLP, speech, translation, and OCR only.

## Capabilities

- Summarise Thai text into a shorter passage via POST /textsum
- Segment Thai text into individual words using NECTEC's tokeniser at /word-tokenize
- Apply part-of-speech tagging and named-entity recognition through /pos-tagging and /ner
- Score Thai text for sentiment with /sentiment for review or social-feed analysis
- Convert between Thai speech and text using /speech-to-text and /text-to-speech
- Translate to and from Thai through /translate and run OCR for Thai-script images via /ocr

## Use cases

### Thai-Language Content Analytics

Analyse Thai-language content from social posts or customer reviews. Tokenise the text with /word-tokenize, run /sentiment for an overall score, and apply /ner to extract named entities. The combined output supports brand monitoring, voice-of-customer dashboards, and Thai-market reporting that English-only NLP services cannot deliver accurately.

Example prompt: POST a Thai review to /word-tokenize, then /sentiment, then /ner, and combine the outputs into a structured analytics record

### Thai Voice Bot

Build a voice bot that listens in Thai and replies in Thai. Send incoming audio to /speech-to-text, generate a textual reply, and use /text-to-speech to produce the spoken response. Useful for IVR systems and voice assistants serving Thai-speaking users.

Example prompt: POST audio bytes to /speech-to-text, generate a Thai reply, then POST that text to /text-to-speech and stream the audio back

### Thai-English Translation Workflow

Translate inbound English support tickets into Thai for local agents and outbound Thai replies into English for QA review. The /translate endpoint handles both directions and pairs naturally with sentiment and tokenisation passes when needed for triage.

Example prompt: POST the English ticket subject to /translate with target=th, then on the agent's reply POST it back with target=en for QA

### Thai-Document OCR

Extract text from scanned Thai documents - invoices, contracts, official forms - using /ocr. The OCR endpoint is purpose-built for Thai script, where general OCR tools tend to misread tone marks and character clusters.

Example prompt: POST the document image to /ocr and parse the returned Thai text into structured invoice fields

### Agent-Driven Thai NLP via Jentic

An agent serving a Thai-language audience picks the right NLP, speech, or vision endpoint based on intent. Through Jentic the agent searches for the operation, the AI For Thai API key is supplied from the vault, and the agent never sees the raw key.

Example prompt: Use Jentic search 'analyse sentiment of Thai text', execute /sentiment on the input, and route negative-sentiment items to a triage queue

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /textsum | Summarise Thai text |
| POST | /word-tokenize | Tokenise Thai text into words |
| POST | /ner | Named entity recognition for Thai text |
| POST | /sentiment | Sentiment analysis for Thai text |
| POST | /speech-to-text | Convert Thai speech to text |
| POST | /text-to-speech | Convert Thai text to speech |
| POST | /translate | Translate text to or from Thai |
| POST | /ocr | OCR for Thai-script images |

## Key resources

- **Text Processing** — Summarisation, tokenisation, POS tagging, NER, and sentiment for Thai text
- **Speech** — Thai speech-to-text and text-to-speech
- **Translation** — Translate to or from Thai via /translate
- **Image Processing** — Object detection and OCR specialised for Thai script

## Why Jentic

- **Setup:** Wiring AI For Thai by hand means handling its Apikey header, matching each Thai-language task to the right endpoint, and writing your own retry logic. Through Jentic you install once, import AI For Thai from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** AI For Thai takes its text and audio inputs in the request body, so scope your agent by operation: limit it to the operations it needs, such as /sentiment or /translate, and leave out speech or OCR endpoints it does not use.
- **Credential handling:** Your AI For Thai API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'analyse sentiment of Thai text', and Jentic returns the matching AI For Thai operation with its TextInput schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI API** — General-purpose LLM API with multilingual support including Thai
- **Hugging Face Inference API** — Hosted inference for community Thai-language models
- **Cloudmersive OCR API** — General OCR that complements AI For Thai when documents mix Thai and Latin scripts

## FAQ

### Why is there no official OpenAPI spec for AI For Thai API?

AI For Thai does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call the AI For Thai API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the AI For Thai API use?

An apiKey scheme called ApiKeyAuth, sent in the request header. Through Jentic the key is held in the vault and never enters the agent's context.

### Can I run sentiment analysis on Thai text?

Yes. POST your Thai text to /sentiment and the API returns a sentiment score tailored to Thai-language content. NECTEC's models are tuned for Thai grammar and vocabulary, so accuracy is typically higher than with English-trained models translated through.

### What are the rate limits for the AI For Thai API?

The spec does not declare explicit rate limits, but the schema does include a 429 RateLimited response on every endpoint. Treat 429 responses as a signal to back off and retry with delay.

### How do I run Thai OCR through Jentic?

Run pip install jentic, search 'extract Thai text from an image', and Jentic returns the AI For Thai /ocr operation. Execute it with the document image and parse the returned Thai text. Run it through Jentic One, the self-hosted execution layer.

### Can I translate between Thai and English?

Yes. POST text to /translate with the desired source and target language. The endpoint supports both Thai-to-English and English-to-Thai translation.

### Can I limit what my agent is allowed to do with the AI For Thai API?

Yes. Because you run Jentic One yourself, your own rules decide which AI For Thai operations and credentials the agent may use. Since every input is passed in the request body, you scope the agent by operation: grant only the endpoints it needs, such as /sentiment or /translate, and withhold the speech and OCR endpoints like /speech-to-text, /text-to-speech, and /ocr that it does not use. The stored API key is injected at execution time and never enters the agent's context.
