ATMOS Developers

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

FieldTypeValues
sentimentstringPositive · Neutral · Negative
tagstringSee 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

TagDescription
complimentÉloge, appréciation positive
remerciementGratitude, reconnaissance
réclamationPlainte, insatisfaction, problème à résoudre
critiqueRetour négatif constructif ou non
questionDemande d'information, interrogation
demande_infoDemande de clarification ou d'information supplémentaire
suggestionProposition d'amélioration, recommandation
supportDemande d'aide ou d'assistance technique
insulteAttaque personnelle, langage grossier
spamContenu promotionnel, hors-sujet
généralTout 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

LimitValue
Max texts per request50
Max text length200 characters (truncated silently beyond)
Rate limit120 requests/min per key
Key access requiredFull (not read-only)
HTTP codeMeaning
400Empty array, all-blank texts, or exceeds 50 items
401Missing or invalid API key
403Key is read-only — request a full-access key
429Groq rate limit hit — retry after a few seconds
503Inference 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.

On this page