Overview
These endpoints are designed for autonomous agents. Registration and discovery
are public. Account and billing status endpoints use the Platform API key from
POST /v1/platform/agent/register.
Base URL:
https://api.tutorflow.io/v1/platformGET /v1/platform/pricing-catalog
Return the live pricing catalog used for billing snapshots and agent pre-flight budgeting.
Authentication
None.
Response Fields
The response is an array.
| Field | Type | Description |
|---|---|---|
category | string | Billable category, e.g. course, slide_image, video_render |
tier | string | Current public tier. The live catalog uses default |
catalogKey | string | Stable catalog key for this category and tier |
amountUsd | number | USD price per unit |
unit | string | Billable unit, e.g. lesson, slide, image, video_minute |
currency | string | USD |
source | string | Pricing source |
stripeLookupKey | string | null | Stripe lookup key when the entry is backed by Stripe metadata |
stripeMeterEventName | string | null | Stripe meter event name for metered billing |
isActive | boolean | Always true for entries returned by this endpoint |
GET /v1/platform/.well-known/agent.json
Return the discovery manifest agents can use to find registration, pricing, capability, add-on, and top-up metadata.
Authentication
None.
Stable Fields
| Field | Type | Description |
|---|---|---|
schema | string | Manifest schema URL |
name | string | Service name |
description | string | Service description |
baseUrl | string | Base REST URL |
auth.type | string | bearer |
auth.prefix | string | tf_platform_ |
registration.endpoint | string | /v1/platform/agent/register |
registration.requiredFields | string[] | name, slug |
registration.optionalFields | string[] | email, agentIdentity |
capabilities | object | Service endpoint, unit, and price hints |
addOns | object | Independently metered add-on events |
trial.creditsUsd | number | Trial display amount in USD |
trial.emailVerificationRequiredForTrial | boolean | false |
trial.emailVerificationRequiredForBilling | boolean | true |
pricing.endpoint | string | /v1/platform/pricing-catalog |
paymentMethods.topUp.endpoint | string | POST /v1/platform/agent/billing/session |
paymentMethods.topUp.minimumUsd | number | 5 |
paymentMethods.topUp.maximumUsd | number | 5000 |
x402 | object | Present only when x402 is enabled |
Agents should treat the manifest as the source of truth for pricing hints, then
call GET /v1/platform/pricing-catalog when exact catalog rows are needed.
POST /v1/platform/agent/register
Create a self-serve platform workspace and return the first API key.
Authentication
None. This endpoint is rate-limited to 5 registrations per IP per hour.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workspace display name |
slug | string | Yes | Unique slug. Lowercase letters, numbers, and hyphens only. Cannot start or end with a hyphen |
email | string | No | Contact email. Trial works without it, but paid top-up cannot complete through public agent endpoints without an email |
agentIdentity | string | No | Free-form agent identity stored in workspace metadata |
Example Request
curl -X POST https://api.tutorflow.io/v1/platform/agent/register \
-H "Content-Type: application/json" \
-d '{
"name": "My AI Tutor",
"slug": "my-ai-tutor",
"email": "agent@example.com",
"agentIdentity": "claude via mcp"
}'Response
{
"organizationId": "0f7a5db7-9f9d-4a46-9f5b-5b8f8ad73001",
"apiKey": "tf_platform_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"keyPrefix": "tf_platform_a1b2c3d4e5f6",
"trialCredits": 100,
"message": "Store your API key securely. It will not be shown again.",
"requiresEmailVerification": true,
"verifyEmailResendEndpoint": "POST /v1/platform/agent/verify-email/resend",
"nextSteps": {
"createSlide": "POST /v1/platform/slides",
"createVideo": "POST /v1/platform/videos",
"accountInfo": "GET /v1/platform/agent/account"
}
}trialCredits and creditBalance are internal credit units. They are stored
as cents, so 100 means $1.00.
Store apiKey immediately. The raw API key is returned only once.
Errors
| HTTP | error.code | Cause | Agent action |
|---|---|---|---|
400 | platform_invalid_request | Invalid slug, invalid email, or malformed body | Fix the request |
409 | platform_conflict | Slug or email is already registered | Choose a new slug or workspace email |
429 | platform_rate_limit_exceeded | IP registration limit exceeded | Back off or reuse the existing workspace |
GET /v1/platform/agent/account
Return workspace identity, status, credit balance, and rate limit for the authenticated API key.
Authentication
Platform API key.
curl https://api.tutorflow.io/v1/platform/agent/account \
-H "Authorization: Bearer tf_platform_..."Response
{
"organizationId": "0f7a5db7-9f9d-4a46-9f5b-5b8f8ad73001",
"name": "My AI Tutor",
"slug": "my-ai-tutor",
"status": "ACTIVE",
"creditBalance": 88,
"rateLimitPerMinute": 1000,
"createdAt": "2026-04-25T00:00:00.000Z"
}GET /v1/platform/agent/billing/status
Return credit balance and card status. This endpoint skips the billing guard, so agents can call it even after credits are exhausted.
Authentication
Platform API key.
curl https://api.tutorflow.io/v1/platform/agent/billing/status \
-H "Authorization: Bearer tf_platform_..."Response
{
"hasPaymentMethod": true,
"cardBrand": "visa",
"cardLast4": "4242",
"creditBalance": 5000,
"billingMode": "internal_invoice"
}cardBrand and cardLast4 are null when no Stripe card is attached.
POST /v1/platform/agent/verify-email/resend
Generate a new 24-hour verification token and send the verification email to the workspace email.
Authentication
Platform API key.
curl -X POST https://api.tutorflow.io/v1/platform/agent/verify-email/resend \
-H "Authorization: Bearer tf_platform_..."Response
{
"message": "Verification email sent"
}Errors
| HTTP | error.code | Cause | Agent action |
|---|---|---|---|
400 | platform_invalid_request | Email is already verified | Continue to billing |
400 | platform_invalid_request | No email address on file | Create a new workspace with email, or use an internal dashboard flow to add one |
GET /v1/platform/agent/verify-email
Verify the workspace email from the link in the verification email.
Authentication
None.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Email verification token from the verification email |
Response
This endpoint redirects to the frontend instead of returning JSON:
| Result | Redirect |
|---|---|
| Verification succeeded | /sign-in/platform?verified=true |
| Token invalid or expired | /sign-in/platform?verified=false |
Agents normally do not call this endpoint directly. A human recipient clicks the email link, then the agent retries billing.
POST /v1/platform/agent/billing/session
Mint a one-hour TutorFlow checkout token and return a hosted checkout page URL. The agent forwards this URL to a human operator, who chooses a top-up amount and pays through Stripe.
Authentication
Platform API key. The billing guard is skipped, but verified email is enforced inside this endpoint.
curl -X POST https://api.tutorflow.io/v1/platform/agent/billing/session \
-H "Authorization: Bearer tf_platform_..."Response
{
"url": "https://tutorflow.io/agent-platform/checkout?token=6c7b1e8d-0b5a-4cb8-a1e4-0473f0001001",
"sessionId": "6c7b1e8d-0b5a-4cb8-a1e4-0473f0001001"
}sessionId is the TutorFlow checkout token. It is not a Stripe cs_...
session ID.
Errors
| HTTP | error.code | Cause | Agent action |
|---|---|---|---|
403 | email_verification_required | Workspace email is not verified | Call POST /v1/platform/agent/verify-email/resend, have the recipient click the link, then retry |
GET /v1/platform/agent/checkout
Validate a checkout token for the hosted checkout page and return workspace display information.
Authentication
None.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | TutorFlow checkout token from POST /v1/platform/agent/billing/session |
Response
{
"email": "agent@example.com",
"name": "My AI Tutor"
}Errors
| HTTP | error.code | Cause |
|---|---|---|
400 | platform_invalid_request | Checkout token has expired |
404 | platform_not_found | Token is unknown or already used |
POST /v1/platform/agent/checkout
Create the actual Stripe Checkout session from a valid TutorFlow checkout token and selected top-up amount.
Authentication
None. This endpoint is intended for the hosted checkout page.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | TutorFlow checkout token from POST /v1/platform/agent/billing/session |
amountUsd | number | Yes | Top-up amount. Minimum 5, maximum 5000 |
Response
{
"url": "https://checkout.stripe.com/c/pay/cs_test_..."
}The checkout token is invalidated after a Stripe URL is created.
Errors
| HTTP | error.code | Cause | Agent action |
|---|---|---|---|
400 | platform_invalid_request | Amount is outside $5 to $5,000, or token is expired | Choose a valid amount or request a new billing session |
403 | email_verification_required | Email became unverified before checkout completion | Verify email, then request a new billing session |
404 | platform_not_found | Token is unknown or already used | Request a new billing session |
GET /v1/platform/health
Validate that an API key can authenticate against the platform.
Authentication
Platform API key. This endpoint skips the billing guard, so it still works when credits are exhausted.
Response
{
"status": "ok",
"organizationId": "0f7a5db7-9f9d-4a46-9f5b-5b8f8ad73001"
}