Inference API
Classify text with sentiment and intent using the ATMOS Groq pipeline — single text or batch up to 50 items.
Overview
The ATMOS Inference API exposes the same Groq-powered classification engine that processes social media comments in real time. Send any French-language text and receive a sentiment label and an intent tag per item — no setup, no model management.
Endpoint: POST /external/v1/infer
Key requirements:
- Bearer token:
atk_live_<key>with full-access (read-only keys cannot use POST endpoints) - Content-Type:
application/json - 1–50 texts per request
Output schema
| Field | Type | Values |
|---|---|---|
sentiment | string | Positive · Neutral · Negative |
tag | string | See Intent tags |
Single text
curl -X POST https://api-atmos.datalab.gouv.tg/external/v1/infer \
-H "Authorization: Bearer atk_live_<your_key>" \
-H "Content-Type: application/json" \
-d '{"texts": ["Merci beaucoup pour ce service rapide !"]}'{
"results": [
{
"text": "Merci beaucoup pour ce service rapide !",
"sentiment": "Positive",
"tag": "remerciement"
}
],
"model": "llama-3.3-70b-versatile",
"count": 1,
"processing_time_ms": 843
}Batch (up to 50 texts)
curl -X POST https://api-atmos.datalab.gouv.tg/external/v1/infer \
-H "Authorization: Bearer atk_live_<your_key>" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Super initiative, bravo à toute l'\''équipe !",
"Le site est inaccessible depuis ce matin.",
"Quand est-ce que le formulaire sera disponible en ligne ?",
"Contenu totalement hors sujet, arrêtez le spam.",
"Je suggère d'\''ajouter une version mobile."
]
}'{
"results": [
{ "text": "Super initiative, bravo à toute l'équipe !", "sentiment": "Positive", "tag": "compliment" },
{ "text": "Le site est inaccessible depuis ce matin.", "sentiment": "Negative", "tag": "réclamation" },
{ "text": "Quand est-ce que le formulaire...", "sentiment": "Neutral", "tag": "question" },
{ "text": "Contenu totalement hors sujet...", "sentiment": "Negative", "tag": "spam" },
{ "text": "Je suggère d'ajouter une version mobile.", "sentiment": "Positive", "tag": "suggestion" }
],
"model": "llama-3.3-70b-versatile",
"count": 5,
"processing_time_ms": 1204
}Intent tags
| Tag | Description |
|---|---|
compliment | Éloge, appréciation positive |
remerciement | Gratitude, reconnaissance |
réclamation | Plainte, insatisfaction, problème à résoudre |
critique | Retour négatif constructif ou non |
question | Demande d'information, interrogation |
demande_info | Demande de clarification ou d'information supplémentaire |
suggestion | Proposition d'amélioration, recommandation |
support | Demande d'aide ou d'assistance technique |
insulte | Attaque personnelle, langage grossier |
spam | Contenu promotionnel, hors-sujet |
général | Tout ce qui ne correspond pas aux autres catégories |
Code examples
JavaScript
const response = await fetch('https://api-atmos.datalab.gouv.tg/external/v1/infer', {
method: 'POST',
headers: {
'Authorization': 'Bearer atk_live_<your_key>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
texts: [
'Merci pour votre réponse rapide.',
'Le service ne fonctionne plus depuis hier.',
],
}),
})
const { results } = await response.json()
// results[0] → { text: '...', sentiment: 'Positive', tag: 'remerciement' }Python
import requests
resp = requests.post(
'https://api-atmos.datalab.gouv.tg/external/v1/infer',
headers={'Authorization': 'Bearer atk_live_<your_key>'},
json={
'texts': [
'Merci pour votre réponse rapide.',
'Le service ne fonctionne plus depuis hier.',
]
},
)
data = resp.json()
for item in data['results']:
print(item['text'], '→', item['sentiment'], '/', item['tag'])Limits & errors
| Limit | Value |
|---|---|
| Max texts per request | 50 |
| Max text length | 200 characters (truncated silently beyond) |
| Rate limit | 120 requests/min per key |
| Key access required | Full (not read-only) |
| HTTP code | Meaning |
|---|---|
400 | Empty array, all-blank texts, or exceeds 50 items |
401 | Missing or invalid API key |
403 | Key is read-only — request a full-access key |
429 | Groq rate limit hit — retry after a few seconds |
503 | Inference service temporarily unavailable |
Notes
- The model is
llama-3.3-70b-versatile(same family as the internal ETL pipeline). - Batches larger than 20 texts are automatically split and run concurrently — latency stays roughly constant regardless of batch size up to 50.
- Input is always treated as French-language text; accuracy on other languages is not guaranteed.
- The endpoint is stateless — no inputs or outputs are stored.