Download OpenAPI specification:Download
query required | string The search query |
extra_languages required | Array of strings Items Enum: "en" "ar" "es" "fr" Additional languages to search in besides the query language |
model | string Default: "sawalni-small" Enum: "sawalni-large" "sawalni-small" "sawalni-mini" "sawalni-micro" ID of the model to use for translations and summary |
rerank | boolean Default: true Whether to rerank results using embeddings |
stream | boolean Default: false Whether to stream back partial progress. In this case the response will first contain |
{- "query": "string",
- "extra_languages": [
- "en"
], - "model": "sawalni-large",
- "rerank": true,
- "stream": false
}
{- "results": [
- {
- "title": "string",
- "url": "string",
- "content": "string"
}
], - "summary": "string"
}
required | Array of objects Array of messages comprising the conversation so far |
model required | string Enum: "sawalni-large" "sawalni-small" "sawalni-mini" "sawalni-micro" ID of the model to use |
stream | boolean Default: false Whether to stream back partial progress |
temperature | number [ 0 .. 1 ] Default: 0.7 Controls randomness in the response |
top_p | number [ 0 .. 1 ] Default: 0.95 Nucleus sampling threshold |
top_k | integer >= 1 Default: 40 Limits vocabulary to top K tokens |
max_tokens | integer >= 1 Default: 512 Maximum number of tokens to generate |
presence_penalty | number [ -2 .. 2 ] Default: 0 Penalty for new tokens based on presence |
frequency_penalty | number [ -2 .. 2 ] Default: 0 Penalty for new tokens based on frequency |
string or Array of strings Sequences where the API will stop generating | |
suffix | string Suffix that comes after completion |
repeat_penalty | number Penalty for repeated tokens |
{- "messages": [
- {
- "role": "system",
- "content": "string"
}
], - "model": "sawalni-large",
- "stream": false,
- "temperature": 0.7,
- "top_p": 0.95,
- "top_k": 40,
- "max_tokens": 512,
- "presence_penalty": 0,
- "frequency_penalty": 0,
- "stop": "string",
- "suffix": "string",
- "repeat_penalty": 0
}
{- "data": {
- "id": "string",
- "object": "string",
- "created": 0,
- "model": "string",
- "choices": [
- {
- "index": 0,
- "message": {
- "role": "string",
- "content": "string"
}, - "finish_reason": "string"
}
]
}
}
input required | string Single text to generate embedding for |
model | string Default: "madmon-mini" Enum: "madmon-mini" "madmon-medium" "all-MiniLM-L12-v2" "paraphrase-multilingual-MiniLM-L12-v2" "all-mpnet-base-v2" "paraphrase-multilingual-mpnet-base-v2" Model to use for embedding generation. "all" models are English-only, "paraphrase-multilingual" models support 50+ languages, "madmon" models support multiple languages including English and Moroccan Darija in Latin and Arabic scripts. |
{- "input": [
- "string"
], - "model": "madmon-medium"
}
{- "object": "list",
- "data": [
- {
- "object": "embedding",
- "index": 0,
- "embedding": [
- 0
]
}
], - "model": "string"
}
text required | string Text to analyze for inappropriate content |
{- "text": "string"
}
{- "data": {
- "religious_identity": 0.7,
- "national_unity": 0.7,
- "political_system": 0.7,
- "regional_relations": 0.7,
- "constitutional_compliance": 0.7,
- "sexual_content": 0.7,
- "violence": 0.7,
- "hate_speech": 0.7
}
}
text required | string Text to classify |
{- "text": "string"
}
{- "data": {
- "category": "hate_speech",
- "confidence": 0.92
}
}
input required | string Single text to identify language for |
model | string Default: "gherbal-mini" Model to use for language identification |
top | integer Default: 1 Number of top language predictions to return (-1 for all) |
{- "input": [
- "string"
], - "model": "gherbal-mini",
- "top": 1
}
{- "data": [
- {
- "input": "string",
- "lang": [
- "string"
]
}
], - "model": "string"
}
text required | string Text to be translated |
source required | string Source language code |
target required | string Target language code |
model | string Default: "tarjamli-medium" Model to use for translation |
{- "text": "string",
- "source": "string",
- "target": "string",
- "model": "tarjamli-medium"
}
{- "data": {
- "input": "string",
- "translated": "string",
- "alternatives": [
- "string"
], - "detected_lang": "string"
}
}
required | string or Array of strings Text or array of texts to transliterate |
model | string Default: "daktilo-mini" Value: "daktilo-mini" Model to use for transliteration |
to | string Default: "latn" Enum: "latn" "arab" Target script (latn for Latin, arab for Arabic). Only "latn" is supported for now. |
temperature | number Default: 0.1 Temperature for the model |
{- "text": "string",
- "model": "daktilo-mini",
- "to": "latn",
- "temperature": 0.1
}
{- "data": {
- "text": "string"
}
}