AICA Assistant — LLM API docs
Public developer documentation for the AICA Assistant enterprise chat API.
Base URL
| Public API | https://api-athena.quebecstore.ca/aica/v1/ |
|---|
Authentication
Send the API key on every protected request:
X-API-Key: your-api-key
Optional body fields for your own tracking (not auth): username, client_user_id.
API keys
- Keys are issued per project by AICA operators.
- Format:
{project}-{keyname}-{ulid} - Example:
athena-chat-01k2d8q9l5v3n7r2t6x8m4wzpd - Optional per-key bind: allowed IP and/or website Origin.
- Keys may include per-minute and per-day request limits.
Limits
- Max prompt length defaults to 1700 characters.
- Over-limit prompts return HTTP 413 /
AICA-E008(not truncated). - Rate limits return HTTP 429 /
AICA-E003.
Endpoints
| Method | URL | Auth | Purpose |
|---|---|---|---|
GET | /aica/v1/health | None | Service status |
POST | /aica/v1/chat | X-API-Key | Text chat with conversation memory + optional web |
Health returns engine: "athena", assistant: "aica-v1:3b", and online (boolean).
Chat
The HTTP body is JSON. Only the response string contains Markdown.
Windows PowerShell — use single quotes around the JSON:
curl.exe -s -X POST "https://api-athena.quebecstore.ca/aica/v1/chat" `
-H "X-API-Key: YOUR-KEY" `
-H "Content-Type: application/json" `
-d '{"prompt":"Ghost of Yotei Standard Edition - PlayStation 5: write a market-ready product title, suggest a CAD retail price, a 3-4 line description, and a 4-8 line sell overview (why buy, value vs higher store prices, awards, gameplay, characters, story). Markdown only.","web":"auto"}'
Simple offline reply (no live web):
curl.exe -s -X POST "https://api-athena.quebecstore.ca/aica/v1/chat" `
-H "X-API-Key: YOUR-KEY" `
-H "Content-Type: application/json" `
-d '{"prompt":"Reply with exactly: OK","web":"off"}'
Continue with the returned conversation_id:
curl.exe -s -X POST "https://api-athena.quebecstore.ca/aica/v1/chat" `
-H "X-API-Key: YOUR-KEY" `
-H "Content-Type: application/json" `
-d '{"conversation_id":"01HEXAMPLECONVERSATIONID000","prompt":"Summarize in 3 bullets.","web":"off"}'
Legacy clients may still send cache_id; prefer conversation_id.
web values
auto— the API decides whether live web lookup is needed for current facts, prices, or news.off— never call live web search; answer from the assistant and conversation memory only. Fastest and cheapest.force— prefer live web search for this request (useful for company ownership / current facts).
Sample response
Shape of a successful chat reply. Markdown lives only inside response.
{
"ok": true,
"request_id": "01KEXAMPLEREQUESTID00000000",
"conversation_id": "01KEXAMPLECONVERSATIONID0000",
"engine": "athena",
"assistant": "aica-v1:3b",
"response": "## Ghost of Yōtei Standard Edition — PlayStation 5\n\n**Suggested retail (CAD):** $89.99\n\n### Description\nStep into feudal Japan as a new legend in the *Ghost* lineage. Ghost of Yōtei delivers cinematic stealth, open-world exploration, and precision combat on PlayStation 5.\n\n### Why buy\n- Flagship PS5 action-adventure with award-caliber presentation\n- Strong value vs higher street prices at big-box retailers\n- Deep story, memorable characters, and refined Ghost gameplay\n- Ideal for single-player fans who want a complete, premium edition",
"usage": {
"prompt_tokens": 412,
"completion_tokens": 286,
"total_tokens": 698,
"duration_seconds": 4.82,
"timing": {
"search": 0.94,
"generate": 3.61
}
},
"web": {
"used": true,
"providers": ["local"],
"sources": [
{
"title": "Example source",
"url": "https://example.com/ghost-of-yotei",
"provider": "local",
"snippet": "…"
}
],
"searches": []
}
}
Language
- French and English only.
- API detects the user language and replies in the same language.
- Other languages get a short bilingual “unsupported” notice.
Error codes
{
"ok": false,
"code": "AICA-E001",
"message": "Access could not be granted. ..."
}
| Code | HTTP | Meaning |
|---|---|---|
AICA-E001 | 403 | Missing/invalid/revoked key, wrong IP/Origin |
AICA-E002 | 400 | Bad JSON / missing fields / invalid conversation_id |
AICA-E003 | 429 | Rate limit / quota |
AICA-E004 | 403 | conversation_id belongs to another key |
AICA-E005 | 503 | LLM engine unavailable / timeout |
AICA-E006 | 503 | Web search unavailable or budget-limited |
AICA-E007 | 400 | Response size exceeded |
AICA-E008 | 413 | Prompt too large |
AICA-E000 | 503 | Service registry unavailable |