How OpsTrainer works
Five steps, each one visible in the API contract.
- Your organisational knowledge. Policies, SOPs, manuals, standards and operational doctrine. You send the text; nothing is scraped or invented.
- The engine. Course structure is planned against your document, then each module is written from the relevant part of it.
- Learning and instruction. The course comes back as modules and lessons, and the AI Lecturer answers questions grounded in that course.
- Competency development. Applied scenarios with answer keys, plus a spaced refresher plan.
- Organisational application. You integrate the outputs into your own LMS, app or workflow. The API is stateless and hands back JSON.
What source grounding does and does not do is set out in Why OpsTrainer. In short: it aligns output to your document. It does not prove your document is right, or that every sentence generated is error-free.
API capabilities
CourseEngine
Turns source material into a structured course: title, subtitle, description, key takeaways and an ordered set of modules, each with lessons. Generation is asynchronous, so a call returns a job id you poll or fetch later.
- Course generation from supplied doctrine, capped at 200,000 characters.
- Learning outcomes supplied by you, checked as 1 to 12 items of 5 to 300 characters.
- Module count from 1 to 12, language and domain from fixed lists.
- Job management: list your jobs, fetch one, delete one.
AI Lecturer
Instruction grounded in a course you already generated, rather than open-domain chat.
- Ask a question against a specific job and get a course-grounded answer.
- Request comprehension questions for a chosen module.
- Available from Tier 2. These calls are rate limited and do not consume credits.
Competency and refresher engine
Shifts the unit of progress from finishing a course to demonstrating judgement, and then keeping it.
- Applied-judgment scenarios: a situation, three decision points, options with a correct index, and a rationale for each, with critical decisions marked.
- Refresher plans: which modules decay fastest, what to revisit, how long each revision should take, and checkpoint months.
- Available from Tier 3.
Scoring is yours. The API returns the answer key so you can mark answers in your own system. OpsTrainer does not certify competence through the API.
Tiers
Three tiers, flat monthly, priced per key. Tier identifiers in the API are tier1, tier2 and tier3; the names below are the customer-facing descriptions of the same things.
| Tier | CourseEngine | AI Lecturer | Competency and refresher | Price |
|---|---|---|---|---|
| 1 — CourseEngine | Yes | No | No | R200 / month per key |
| 2 — AI Lecturer | Yes | Yes | No | R800 / month per key |
| 3 — Full Engine | Yes | Yes | Yes | R4,500 / month per key |
Every tier carries a monthly credit quota and a per-minute rate limit, both set per key. There are no overage charges: when the quota is reached the API refuses further credit-consuming work until the next month or an upgrade.
"Competency assurance" describes what Tier 3 enables: assessment and refresher capability. It is not a claim that the platform independently certifies anyone's competence.
Why OpsTrainer
| Conventional AI learning tools | OpsTrainer |
|---|---|
| General-purpose content generation | Learning built from the source material you supply |
| Generic course structures | Structure planned across your whole document, in your sequence |
| General AI assistance | Instruction grounded in a specific generated course |
| Knowledge questions | Applied scenarios with answer keys and critical decisions marked |
| One-off learning experiences | Refresher plans that name what decays and when to revisit it |
The honest limit. Source grounding aligns output with the document you provide. The API also reports two machine checks alongside a completed course: structural quality, which measures output shape and module structure, and source coverage, which measures overlap between generated text and your source vocabulary. Neither proves that a procedure, dose, negation or causal claim is correct. Have qualified people review safety-critical material before you rely on it.
Developer quick start
Base URL and authentication
All calls go to https://www.opstrainer.co.za under /api/v1, authenticated with your key in an X-API-Key header. Keys are issued per organisation, so a key only ever sees its own organisation's jobs.
# store your key once, then reuse the header
AUTH="X-API-Key: $OPSTRAINER_API_KEY"
curl https://www.opstrainer.co.za/api/v1/me --header "$AUTH"
Generate a course
curl -X POST https://www.opstrainer.co.za/api/v1/forge/courses \
--header "$AUTH" \
--header "Content-Type: application/json" \
-d '{
"topic": "Water point rehabilitation",
"audience": "WASH field officers",
"outcomes": ["Sequence a rehabilitation safely", "Identify contamination risks"],
"num_modules": 3,
"language": "en",
"domain_id": "wash",
"doctrine": "Your SOP or manual text here, up to 200,000 characters."
}'
A successful request returns 202 with a job id, and generation continues in the background.
{
"success": true,
"job_id": "fd2a1b41-678b-42e1-b90b-8dde429ecafc",
"status": "queued",
"poll": "GET /api/v1/forge/courses/fd2a1b41-678b-42e1-b90b-8dde429ecafc"
}
Fetch the result
curl https://www.opstrainer.co.za/api/v1/forge/courses/JOB_ID --header "$AUTH"
While it runs you get status plus modules_completed and modules_total. When it completes, course appears with title, structure, modules (each lesson carrying title, objectives, content, duration_minutes), and the two quality blocks described above.
Errors, credits and limits
| Status | Meaning |
|---|---|
| 400 | The request was refused before any work started: missing fields, an unknown language or domain, or an outcome out of bounds. |
| 403 | The key's tier does not include this endpoint. |
| 404 | That job does not belong to this organisation, or does not exist. |
| 413 | Doctrine larger than 200,000 characters. |
| 429 | Monthly credit quota exhausted, or the per-minute rate limit hit. |
| 502 | The engine could not produce usable output. Any credit spent on it is returned. |
Credits are consumed by course generation, competency scenarios and refresher plans, one per call. A request refused with 400 costs nothing, because validation happens before the credit is taken. Reading jobs and calling the AI Lecturer does not consume credits; those calls are rate limited only.
Allowed values
language: en af zu xh fr ar es pt sw am so ha om ti rw
domain_id: humanitarian medical security logistics programme wash nutrition protection education business cybersecurity finance
Unknown values are refused rather than passed through, which is why they are listed here.
Endpoint reference
Nine endpoints. Paths, methods and payloads are exactly as served.
Account
| Method and path | Purpose | Tier | Credit |
|---|---|---|---|
GET /api/v1/me | Key name, tier, rate limit, monthly quota and this month's usage. | 1 | No |
Course generation and job management
| Method and path | Purpose | Tier | Credit |
|---|---|---|---|
POST /api/v1/forge/courses | Start a course from doctrine. Returns 202 and a job id. | 1 | 1 |
GET /api/v1/forge/courses | List this organisation's jobs, most recent first, metadata only. | 1 | No |
GET /api/v1/forge/courses/:jobId | Job status, or the finished course JSON. | 1 | No |
DELETE /api/v1/forge/courses/:jobId | Delete a job and its generated content immediately. | 1 | No |
AI Lecturer
| Method and path | Purpose | Tier | Credit |
|---|---|---|---|
POST /api/v1/lecturer/ask | Ask a question grounded in a generated course. | 2 | No |
POST /api/v1/lecturer/questions | Comprehension questions for a chosen module. | 2 | No |
Competency assessment
| Method and path | Purpose | Tier | Credit |
|---|---|---|---|
POST /api/v1/competency/questions | Applied scenarios with options, correct index and rationale. | 3 | 1 |
Refresher planning
| Method and path | Purpose | Tier | Credit |
|---|---|---|---|
POST /api/v1/refresher/plan | Spaced revision plan with focus areas and checkpoints. | 3 | 1 |
Example: competency scenarios
curl -X POST https://www.opstrainer.co.za/api/v1/competency/questions \
--header "$AUTH" \
--header "Content-Type: application/json" \
-d '{"job_id":"JOB_ID","count":3,"critical":true}'
Each scenario carries situation and decisions; each decision carries prompt, options, correct_index, rationale and critical. Scenarios that fail structural validation are never returned: options must number 2 to 5, correct_index must fall inside its options, and a critical decision must be present when requested. If generation fails those checks you get 502 and the credit back.
Data governance and security
What the implementation actually does, stated plainly.
| Question | What happens |
|---|---|
| How are keys stored? | Only a SHA-256 hash and a visible prefix. The raw key is shown once when issued and cannot be recovered afterwards. |
| Organisation separation | Every job lookup and deletion is scoped by organisation as well as key, so one organisation cannot read another's jobs. |
| Source material | Held only for the life of the job. It is cleared when generation completes, cleared in the same statement when a job fails, and swept if a job is stranded. |
| Generated content retention | Seven days, then purged automatically. You can delete a job sooner with DELETE. |
| Rate limiting and quotas | Per key: a per-minute request limit and a monthly credit quota, both visible at /me. |
| Certificates | The API never issues certificates. Certification stays on the platform, where it can be verified independently. |
Two points we will not overstate. "Deleted from OpsTrainer" is accurate; what a model provider retains on its own side is governed by that provider's terms, and we would rather you ask us than assume. And no compliance certification should be inferred from this page: if you need a specific assurance for procurement, ask support@opstrainer.co.za and we will answer in writing.
Commercial information
Four different things, often confused, so they are separated here.
- Credit is the unit of engine work: one course generation, one competency set, one refresher plan. Credits do not carry over.
- Monthly quota is how many credits a key may spend in a calendar month, shown at
/me. Reaching it returns 429 until the month resets or the key is upgraded. - Rate limit caps requests per minute and is separate from credits. Lecturer calls and job reads are rate limited only.
- Access is arranged with us: keys are issued per organisation, with the tier, quota and limit set on the key.
Current API pricing is on the pricing page and is unchanged by this documentation: Tier 1 R200, Tier 2 R800, Tier 3 R4,500 per month, flat, per key, with no overage charges.
Questions people ask
What can I generate with the API?
Structured courses from your own source text, course-grounded answers and comprehension questions, applied competency scenarios, and refresher plans. Not free-form content unrelated to a source document.
Can I use my own organisational documentation?
That is the point of it. Send policies, SOPs, manuals or standards as the doctrine field, up to 200,000 characters. Structure is planned across the whole document rather than its opening pages.
Does the API issue certificates?
No. It returns learning and assessment content. Certificates are issued on the platform, against platform records, and can be verified by link.
How does the AI Lecturer work?
You generate a course first, then ask questions against that job. Answers are grounded in that course rather than in general knowledge, which is also why there is no lecturer endpoint without a job.
How are credits consumed?
One per course generation, per competency set and per refresher plan. A request refused with 400 costs nothing. A failed generation is refunded. Lecturer calls and job reads cost no credits.
How long are jobs retained, and can I delete them?
Seven days, then purged. You can delete one at any time with DELETE on the job, which removes the generated content with it.
Does OpsTrainer integrate with external learning platforms?
The API is stateless JSON, so it fits an LMS, an internal tool or a data pipeline. We do not ship prebuilt connectors, and we will not pretend there are any.
How do I obtain a key?
Keys are issued per organisation from our side, with the tier and quota agreed with you. Ask us through the access section below.
What happens when I reach my quota?
Calls that would consume a credit return 429 with the quota and usage in the body. Reading jobs and lecturer calls keep working because they do not spend credits.
Build learning around the knowledge your organisation already owns
Integrate OpsTrainer into your existing systems and turn organisational knowledge into structured learning and competency-development experiences.
API keys are issued per organisation, with the tier, monthly quota and rate limit agreed with you. Tell us your team size, what you want to generate, and the system you are integrating with.