API Reference¶
The 6 Djinn services expose REST APIs (FastAPI) with auto-generated Swagger documentation on each service (/docs).
Convention
All routes are prefixed with /v1/ (ADR-005). Authentication via the X-API-Key header.
Local vs Production
The examples in this documentation use NodePort URLs (localhost:3000X) for local Docker Desktop K8s development — direct access to services for debugging.
In production, all requests go through Kong APIM (https://api.djinn.solyntek.io), which handles API key authentication, rate limiting and routing to internal services. Services are never exposed directly in production (ClusterIP only). See the internal documentation (Kong APIM, ADR-013).
Kong AI Gateway (Phase 3)
Starting with Phase 3, LLM routing will be handled by the Kong AI Gateway plugins (ai-proxy, ai-prompt-template, etc.) to centralize prompts and multi-provider fallback. See ADR-014 (internal documentation).
Getting Started¶
1. Base URL¶
All requests go through the Kong gateway:
Kong routes each /v1/... prefix to the corresponding internal service: you only need
one URL and one key to manage, regardless of the service being called.
2. Authentication¶
Each tenant receives an API key (associated with a Kong consumer), to be passed in the
X-API-Key header of every request:
Without a valid key, Kong responds with 401 Unauthorized before the request even reaches the
service. Rate limiting is also applied per key (429 Too Many Requests beyond the quota). See the
Authentication guide.
3. First call: extract an invoice end-to-end¶
Extraction is synchronous: a single call is enough to send the file and retrieve the structured data.
curl -X POST https://api.djinn.solyntek.io/v1/extract \
-H "X-API-Key: your-api-key" \
-F "file=@invoice.pdf" \
-F "document_type=invoice"
{
"document_type": "invoice",
"data": {
"vendor_name": "Acme SARL",
"invoice_number": "FA-2026-0042",
"invoice_date": "2026-06-30",
"total_ht": 1250.00,
"total_ttc": 1500.00,
"vat_amount": 250.00,
"iban": "FR7630001007941234567890185"
},
"confidence": 0.93
}
From there, the same JSON can feed the other services with the same key: generate an accounting
export (POST /v1/export/fec), verify the supplier
(GET /v1/companies/{siren}/compliance) — each call being logged
in the audit trail (GET /v1/events).
4. Explore the APIs¶
Each service page below combines a route overview, curl examples and an
interactive reference generated from the service's versioned OpenAPI spec.
Services¶
-
POST /v1/extract— Invoices, resumes, ID documentsPort
8000· NodePort30002 -
POST /v1/analyze— Candidate scoring vs job postingsPort
8003· NodePort30003 -
POST /v1/knowledge-bases/{id}/query— RAG chatPort
8004· NodePort30004 -
POST /v1/export/fec— FEC, Sage, Pennylane, payrollPort
8005· NodePort30005 -
POST /v1/events— GDPR audit logPort
8006· NodePort30006 -
GET /v1/companies/{siren}/compliancePort
8007· NodePort30007
OpenAPI Specs¶
In accordance with ADR-011, each service's OpenAPI spec is exported from the code
(app.openapi(), without starting a server) and committed to this repo — the single source of
truth for third-party clients, with no need for access to the service repos.
| Service | OpenAPI Spec |
|---|---|
| Doc Extract | openapi/doc-extract-v1.json |
| Candidate Analyzer | openapi/candidate-analyzer-v1.json |
| AI Assistant | openapi/ai-assistant-v1.json |
| Export Hub | openapi/export-hub-v1.json |
| Audit Trail | openapi/audit-trail-v1.json |
| Company Verifier | openapi/company-verifier-v1.json |
MCP Gateway
The mcp-gateway service is a special case: it exposes the capabilities of the 6 services via
the MCP protocol (Model Context Protocol) on the /mcp endpoint, for agents and MCP
clients (rather than REST integrations). Built on FastMCP, it does not expose a FastAPI
object and therefore has no OpenAPI spec — which is why it does not appear in the list
above. See the MCP tool catalog in the internal documentation
(architecture/mcp-gateway.md).
Regeneration: documentation/scripts/export_openapi.py (one run per service, from that service's
venv — see the script's docstring).