> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/api-references/bhashik-text-api.md).

# Bhashik Text API

## POST /api/v1/languagelabs/language-detection

> Detect language(s) in text

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Text Services API","version":"1.0.1"},"tags":[{"name":"Language Detection","description":"Detect primary and secondary languages with confidence from input text."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Provide your API key as a Bearer token: Authorization: Bearer <KRUTRIM_API_KEY>"}},"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized — Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found — The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary."},"detail":{"type":"object","description":"Additional diagnostic details.","properties":{"info":{"type":"string","description":"Extra context about the error."}}}}}}},"paths":{"/api/v1/languagelabs/language-detection":{"post":{"tags":["Language Detection"],"summary":"Detect language(s) in text","operationId":"detectLanguage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","description":"Input text to analyze."}}}}}},"responses":{"200":{"description":"Detected languages with confidences.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```

## POST /api/v1/languagelabs/entity-extraction

> Extract entities and PII

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Text Services API","version":"1.0.1"},"tags":[{"name":"Entity Extraction","description":"Extract PII and named entities; optionally keywords, profanity, and task type."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Provide your API key as a Bearer token: Authorization: Bearer <KRUTRIM_API_KEY>"}},"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized — Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary."},"detail":{"type":"object","description":"Additional diagnostic details.","properties":{"info":{"type":"string","description":"Extra context about the error."}}}}}}},"paths":{"/api/v1/languagelabs/entity-extraction":{"post":{"tags":["Entity Extraction"],"summary":"Extract entities and PII","operationId":"extractEntities","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","param_list","lang_from"],"properties":{"text":{"type":"string","description":"Input text to analyze."},"lang_from":{"type":"string","description":"Language code for input text (e.g., hin, ben, mar, tam, tel, kan, mal, pan, guj).\n","enum":["hin","ben","mar","tam","tel","kan","mal","pan","guj"]},"param_list":{"type":"array","description":"Select which extractions to run. Supported: keywords, profanity, ner, task_type, pii.\n","items":{"type":"string","enum":["keywords","profanity","ner","task_type","pii"]}}}}}}},"responses":{"200":{"description":"Extracted entities and PII.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"color":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}}}}}},"Total_entities":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## POST /api/v1/languagelabs/summarization

> Summarize text

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Text Services API","version":"1.0.1"},"tags":[{"name":"Summarization","description":"Generate a concise summary for input text."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Provide your API key as a Bearer token: Authorization: Bearer <KRUTRIM_API_KEY>"}},"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized — Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary."},"detail":{"type":"object","description":"Additional diagnostic details.","properties":{"info":{"type":"string","description":"Extra context about the error."}}}}}}},"paths":{"/api/v1/languagelabs/summarization":{"post":{"tags":["Summarization"],"summary":"Summarize text","operationId":"summarizeText","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","input_language","summary_size"],"properties":{"text":{"type":"string","description":"Text to summarize."},"input_language":{"type":"string","description":"Language code for the input text.\nSupported: eng (English), hin (Hindi), ben (Bengali), mar (Marathi), tam (Tamil),\ntel (Telugu), kan (Kannada), mal (Malayalam), pan (Punjabi), guj (Gujarati).\n","enum":["eng","hin","ben","mar","tam","tel","kan","mal","pan","guj"]},"summary_size":{"type":"integer","description":"Target summary size in words.","minimum":1}}}}}},"responses":{"200":{"description":"Summary generated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"data":{"type":"object","properties":{"summaryText":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## POST /api/v1/languagelabs/translation

> Translate text

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Text Services API","version":"1.0.1"},"tags":[{"name":"Translation","description":"Translate text between supported languages."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Provide your API key as a Bearer token: Authorization: Bearer <KRUTRIM_API_KEY>"}},"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized — Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary."},"detail":{"type":"object","description":"Additional diagnostic details.","properties":{"info":{"type":"string","description":"Extra context about the error."}}}}}}},"paths":{"/api/v1/languagelabs/translation":{"post":{"tags":["Translation"],"summary":"Translate text","operationId":"translateText","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","src_language","tgt_language","model"],"properties":{"text":{"type":"string","description":"Input text to translate."},"src_language":{"type":"string","description":"Source language code (e.g., eng_Latn)."},"tgt_language":{"type":"string","description":"Target language code (e.g., hin_Deva)."},"model":{"type":"string","description":"Translation model to be used.","enum":["krutrim-translate-v1.0"]}}}}}},"responses":{"200":{"description":"Translation generated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"data":{"type":"object","properties":{"translated_text":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```

## POST /api/v1/languagelabs/sentiment-analysis

> Analyze sentiment

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Text Services API","version":"1.0.1"},"tags":[{"name":"Sentiment Analysis","description":"Identify sentiment labels for input text."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Provide your API key as a Bearer token: Authorization: Bearer <KRUTRIM_API_KEY>"}},"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized — Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary."},"detail":{"type":"object","description":"Additional diagnostic details.","properties":{"info":{"type":"string","description":"Extra context about the error."}}}}}}},"paths":{"/api/v1/languagelabs/sentiment-analysis":{"post":{"tags":["Sentiment Analysis"],"summary":"Analyze sentiment","operationId":"analyzeSentiment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","lang_from"],"properties":{"text":{"type":"string","description":"Input text to analyze."},"lang_from":{"type":"string","description":"Language code for input text (e.g., eng, hin, ben, mar, tam, tel, kan, mal, pan, guj).\n","enum":["eng","hin","ben","mar","tam","tel","kan","mal","pan","guj"]}}}}}},"responses":{"200":{"description":"Sentiment labels detected.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"Sentiment":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"array","items":{"type":"string"}}}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloud.olakrutrim.com/api-references/bhashik-text-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
