canonical: https://jentic.com/apis/messagebird.com/messagebird-language-detection-api

# Messagebird LanguageDetection

Jentic publishes the only available OpenAPI specification for LanguageDetection, keeping it validated and agent-ready. The MessageBird Language Detection API identifies the natural language of a short text snippet, returning a language code that downstream services can use to route, translate, or classify the message correctly. It exposes the predict endpoint and a list of supported languages, making it a small focused building block for multilingual messaging pipelines. Predictions are designed for the kinds of short utterances seen in SMS, WhatsApp, and chat traffic.

## For AI agents

Detect the language of a phrase and return a language code so an agent can route, translate, or classify multilingual messages.

## Scope

Does not handle translation, intent classification, or entity extraction - use for language identification of short text only.

## Capabilities

- Detect the language of an inbound SMS phrase before routing it to a locale-specific workflow
- Branch a chatbot reply path on the detected language code returned by the predictor
- Confirm whether a target language is supported before submitting prediction traffic
- Filter inbound message streams by detected language for analytics segmentation
- Pre-screen messages so unsupported locales are escalated to a human reviewer

## Use cases

### Multilingual Inbound Routing

When inbound SMS or chat messages can arrive in any language, Language Detection identifies the locale so the workflow can route each message to a language-specific support team or classifier. The API takes a phrase and returns a language code in a single call, with no training step required. This removes brittle keyword heuristics and keeps multilingual queues clean.

Example prompt: POST a customer message to /api/v1/predict-language and route it to the Spanish queue when the predicted language code is 'es'

### Pre-Translation Locale Detection

Before sending a message to a translation service, agents call Language Detection to identify the source language so the translator does not have to auto-detect or guess. This produces more accurate translations and lets the agent skip the translate step entirely when the detected language already matches the target locale. The supported-languages endpoint lets the workflow short-circuit unsupported pairs.

Example prompt: Call POST /api/v1/predict-language to identify the source language, then translate the message only if the detected code differs from the target locale

### Compliance and Analytics Segmentation

Tag every inbound message with a detected language code so downstream analytics, audit logs, and compliance dashboards can segment volume by locale. This is especially useful for support teams that need to report SLA performance per language or that operate in regions with multilingual customer bases. Detection runs in line with ingestion and adds the language code as a structured field on each record.

Example prompt: Enrich each inbound message record with the language code returned by POST /api/v1/predict-language for downstream reporting

### AI Agent Integration via Jentic

An AI agent uses Jentic to discover Language Detection by intent search ('detect the language of a message'). Jentic returns the predict-language operation with its input schema, so the agent submits a phrase and receives a structured language code in a single load-and-execute step. The MessageBird AccessKey is held in your Jentic One instance and never exposed to the agent.

Example prompt: Use Jentic to search 'detect the language of a phrase', load the predict-language schema, and execute it to enrich an inbound chat record

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /api/v1/predict-language | Predict the language of a submitted phrase |
| GET | /api/v1/supported-languages | List supported detection languages |

## Key resources

- **Predictions** — Detected language code returned for a submitted phrase
- **Supported Languages** — List of language codes the detector can recognise

## Why Jentic

- **Setup:** Wiring the MessageBird LanguageDetection API by hand means attaching your AccessKey to each request against the language-detection.messagebird host, shaping the predict-language body, and handling retries yourself. Through Jentic you install once, import the LanguageDetection API from the API Directory, store the AccessKey once, and your agent calls it.
- **Permission scoping:** The LanguageDetection API takes the text in the request body rather than as a URL path resource, so scope your agent to the operations it needs: limit it to POST /api/v1/predict-language and the supported-languages lookup, and leave out anything else.
- **Credential handling:** Your MessageBird AccessKey is stored once, encrypted, by your own Jentic One instance and attached at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'detect the language of a phrase', and Jentic returns the predict-language operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **MessageBird Intent** — Classify a phrase into a trained intent label after the language has been detected
- **MessageBird Named Entity Recognition** — Extract named entities like locations and dates from the same message
- **OpenAI API** — General-purpose LLM that can detect language via prompting in addition to many other NLP tasks
- **Cohere** — Hosted NLP API offering classification and language tools as part of a broader toolkit

## FAQ

### Why is there no official OpenAPI spec for LanguageDetection?

MessageBird does not publish an OpenAPI specification for the Language Detection API. Jentic generates and maintains this spec so that AI agents and developers can call it 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 MessageBird Language Detection API use?

Authentication is an API key sent in the `Authorization` header, prefixed with the literal word `AccessKey`. Through Jentic, the access key is held in your Jentic One instance and injected at request time, so the raw key is never exposed to the agent.

### Which languages can the detector recognise?

Call GET /api/v1/supported-languages to fetch the full set at runtime. The list evolves as MessageBird extends coverage, so do not hardcode it in agent prompts or workflow definitions.

### How do I detect the language of a message through Jentic?

Search Jentic for `detect the language of a phrase`, load the POST /api/v1/predict-language operation, and execute it with your text. Jentic returns the predicted language code as a structured response your agent can branch on.

### Is the Language Detection API designed for long documents?

The endpoint is optimised for the short utterances seen in SMS, WhatsApp, and chat traffic. For long-form document language identification, evaluate accuracy on representative samples or pair it with a general-purpose NLP model.

### Are there published rate limits?

The OpenAPI spec does not declare quantitative rate limits. Check your MessageBird account dashboard or contact MessageBird support for the limits attached to your plan before bulk-detecting traffic.

### Can I limit what my agent is allowed to do with the MessageBird Language Detection API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use, and this API exposes only two: POST /api/v1/predict-language to detect a phrase's language and GET /api/v1/supported-languages to list recognised locales. You can scope the agent to just the predict-language call, or add the supported-languages lookup, and leave every other operation out. Your MessageBird AccessKey is held by your own instance and attached at request time, so the agent detects languages without ever seeing the raw key.
