TutorFlow Agent Platform
An API and MCP server your agent uses to build courses and grade answers
It signs itself up and pays per action.
Your agent's first four calls
Open one step at a time. Step 1 sets TUTORFLOW_KEY and CLASSROOM_ID, which the other steps use.
Needs curl and jq. Change the slug and email before you run it.
1Register the agent
One call with no key. The answer holds contentApiKey, defaultClassroomId, and 50 trial credits. The key is shown once, so keep it.
RESPONSE=$(curl -s -X POST https://api.tutorflow.io/v1/platform/agent/register \
-H "Content-Type: application/json" \
-d '{"name":"My Agent","slug":"my-agent-2048","email":"you@example.com"}')
export TUTORFLOW_KEY=$(echo "$RESPONSE" | jq -r .contentApiKey)
export CLASSROOM_ID=$(echo "$RESPONSE" | jq -r .defaultClassroomId)2Start a course
TutorFlow writes the course in the background and answers 202 with a runId. A one-lesson course costs 6 credits.
RUN_ID=$(curl -s -X POST \
"https://api.tutorflow.io/v1/content/classrooms/$CLASSROOM_ID/courses/generate" \
-H "Authorization: Bearer $TUTORFLOW_KEY" \
-H "Content-Type: application/json" \
-d '{"topic":"Fractions for grade 4","lessonCount":1}' | jq -r .runId)3Follow the run
Read the run every 20 to 30 seconds until status is completed or failed. When it completes, resourceId holds the new course's ID.
curl -s "https://api.tutorflow.io/v1/content/classrooms/$CLASSROOM_ID/runs/$RUN_ID" \
-H "Authorization: Bearer $TUTORFLOW_KEY" | jq '{status, resourceId, error}'4Grade an answer
Evaluations answer at once with a score, strengths, and suggestions. Each one costs 1 credit.
Request
curl -s -X POST "https://api.tutorflow.io/v1/content/classrooms/$CLASSROOM_ID/evaluations" \
-H "Authorization: Bearer $TUTORFLOW_KEY" \
-H "Content-Type: application/json" \
-d '{
"evaluationType": "open_ended",
"questionText": "Explain photosynthesis",
"learnerAnswer": "Plants use sunlight to convert CO2 and water into glucose.",
"maxScore": 10,
"language": "en",
"learnerExternalId": "learner-42"
}'Response
{
"id": "5023...",
"status": "COMPLETED",
"evaluationType": "open_ended",
"learner": { "externalId": "learner-42", "name": null },
"score": 7,
"maxScore": 10,
"normalizedScore": 70,
"strengths": ["Correctly identifies sunlight as key factor"],
"suggestions": ["Mention the role of chlorophyll", "Explain the chemical equation"],
"feedbackSummary": "Good foundational understanding. To improve, include the role of chlorophyll."
}Prefer a terminal? Use the CLI
@tutorflow/cli makes the same calls. agent register saves the key to ~/.tutorflow/config.json, so the commands after it need no key or classroom flag.
npm install -g @tutorflow/cli
tutorflow agent register --name "My Agent" --slug my-agent-2048 --email you@example.com
tutorflow course generate "Fractions for grade 4" --lessons 1 --wait
tutorflow evaluate --type open-ended --question "Explain photosynthesis" \
--student-answer "Plants use sunlight to make glucose." --learner-id learner-42What your agent can do without asking anyone
One Content API key works over REST, MCP, and the CLI. REST reaches everything; MCP covers sign-up, billing, courses, and grading.
Grade learner answers
Send an answer with a rubric or a reference answer. The score, strengths, and suggestions come back as typed fields.
Make teaching material
Start a course, test, slide deck, video, or module with one call, then follow the run until it finishes.
Call it as MCP tools
Add the server URL and a key, and Claude Code or any MCP client can use TutorFlow as tools.
Sign up without a person
Your agent registers its own account and gets a key, a classroom, and 50 trial credits in the same answer.
Know what each call costs
Every action draws a fixed number of credits, at 2 cents each, from one balance, and estimatedCredits arrives before the run starts. Rate limits come back in response headers.
Keys for each job
Keep test and live keys apart, scope each key, and rotate it. A test key works in a sandbox classroom and spends nothing.
Hear when work finishes
Register a webhook and get a signed request when a generation run, a video render, or an evaluation ends.
In the language your agent asks for
Content and feedback come back in the language your agent asks for.
Built for agents, not just humans.
Your agent finds TutorFlow's tools on its own: sign up, check the balance, generate a course, follow the run, and grade answers, with no HTTP code to write.
- Add one server entry to your MCP client's config, and Claude, Gemini, or any other MCP client connects
- Your agent signs itself up and gets a key in the same call
- When credits run low, it sends a person a checkout link or, where x402 is enabled, pays in USDC itself
- Typed inputs, so a bad call comes back with the reason
Claude Code
// .mcp.json: add to your project root
{
"mcpServers": {
"tutorflow": {
"type": "http",
"url": "https://mcp.tutorflow.io/api/mcp",
"headers": {
"Authorization": "Bearer tf_content_..."
}
}
}
}MCP SDK
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'
const transport = new StreamableHTTPClientTransport(
new URL('https://mcp.tutorflow.io/api/mcp'),
{
requestInit: {
headers: { Authorization: 'Bearer tf_content_...' },
},
},
)
const client = new Client({ name: 'my-agent', version: '1.0.0' })
await client.connect(transport)
// Call tools directly
const result = await client.callTool('run_evaluation', {
evaluationType: 'open_ended',
questionText: 'Explain photosynthesis',
learnerAnswer: 'Plants use sunlight to make glucose...',
})Self sign-up
// No auth needed: agents register themselves
POST https://api.tutorflow.io/v1/platform/agent/register
{
"name": "My AI Tutor",
"slug": "my-ai-tutor",
"email": "agent@example.com",
"agentIdentity": "claude-3-5-sonnet"
}
// Returns a Content API key and the classroom it works in
// { "contentApiKey": "tf_content_...", "defaultClassroomId": "...", "trialContentCredits": 50 }Pay for what your agent makes
Every call draws from one credit balance on your account, at 2 cents a credit. This is the live price list your agent is charged from.
| What you make | Credits | US dollars |
|---|---|---|
| A course with its outline and every lesson | 3 credits plus 6 credits per lesson | $0.06 plus $0.12 per lesson |
| One lesson module | 6 credits per lesson | $0.12 per lesson |
| A test with auto-graded questions | 3 credits per test | $0.06 per test |
| A text page in a slide deck | 1 credit per text page | $0.02 per text page |
| A slide page with an AI image | 3 credits per image page | $0.06 per image page |
| Narrating a video's scenes | 1 credit per 200 narration characters | $0.02 per 200 narration characters |
| Rendering a video to MP4 | 3 credits per render | $0.06 per render |
| A game ready to play | 41 credits per game | $0.82 per game |
| Grading one answer | 1 credit per request | $0.02 per request |
How billing works
- Top up from $5 by card, or with USDC on Base, once your email is verified.
- With a card on file, work keeps going after your credits run out, and that use is billed to the card.
- A new account starts with 50 free credits.
- Test keys work in a sandbox classroom and spend no credits.
Let your agent make its first course today
Register over the API, MCP, or CLI. The 50 trial credits cover a first course and a few graded answers.