Base URL & Authentication

All API requests are made to:

https://ed-agent.com

Authenticate every request with your API key in the x-api-key header. API keys use the format edagent_xxxxxxxxxx.

# Example header
x-api-key: edagent_your_key_here
No subscription needed. You're charged per task at the fixed price shown below. Your API key is linked to your account balance — tasks are debited automatically.

Quick Start

Run a quick research task with curl:

curl -X POST https://ed-agent.com/api/tasks/quick_research \
  -H "Content-Type: application/json" \
  -H "x-api-key: edagent_your_key_here" \
  -d '{"input": "metacognitive strategies in secondary schools"}'

Example response:

{
  "ok": true,
  "result": "## Metacognitive Strategies in Secondary Schools\n\n...",
  "taskType": "quick_research",
  "amountUsd": 0.5,
  "creditsUsed": 0.5
}

Available Tasks

Use the task ID as the :taskType path parameter when calling POST /api/tasks/:taskType.

Task ID Name Price Input (the input field)
quick_research Quick Research $0.50 Topic to research
curriculum_resource Curriculum Resource $3.00 Topic (pass options.year_group for year group)
blog_post Blog Post / Article $5.00 Blog post title
seo_content SEO Content $4.00 Topic for SEO content
strategy_brief Strategy Brief $8.00 Strategic topic or challenge

You can also fetch this list dynamically:

GET /api/tasks

Endpoint Reference

POST /api/tasks/:taskType

Run an AI education task. The response includes the completed content as a string.

Request body:

FieldTypeRequiredDescription
input string Yes The topic, title, or subject for the task
options object No Task-specific options. For curriculum_resource: { year_group: "Year 8" }

Success response (200):

FieldTypeDescription
okbooleanAlways true on success
resultstringThe AI-generated content
taskTypestringThe task type that was run
amountUsdnumberAmount charged in USD
creditsUsednumberSame as amountUsd

Curriculum resource example (with options):

curl -X POST https://ed-agent.com/api/tasks/curriculum_resource \
  -H "Content-Type: application/json" \
  -H "x-api-key: edagent_your_key_here" \
  -d '{
    "input": "The Water Cycle",
    "options": { "year_group": "Year 6" }
  }'

GET /api/tasks

List all available task definitions.

curl https://ed-agent.com/api/tasks \
  -H "x-api-key: edagent_your_key_here"

GET /api/usage/:apiKey

Get usage summary for an API key. Returns total calls, total spend, and a per-task breakdown.

curl https://ed-agent.com/api/usage/edagent_your_key_here \
  -H "x-api-key: edagent_your_key_here"
{
  "ok": true,
  "apiKey": "edagent_****",
  "totalCalls": 12,
  "totalSpendUsd": 18.50,
  "breakdown": [
    { "taskType": "quick_research", "calls": 8, "spendUsd": 4.00 },
    { "taskType": "blog_post", "calls": 2, "spendUsd": 10.00 }
  ]
}

Errors

All errors return { "ok": false, "error": "..." } with an appropriate HTTP status code.

StatusErrorCause
401Invalid API keyMissing or unrecognised x-api-key header
400Body must include a non-empty "input" stringMissing or blank input field in request body
404Unknown task type: ...:taskType not in the list of supported tasks
429Rate limit exceededMore than 10 requests per minute on this key
500Task failed. Please try again.OpenAI or internal error

Rate Limits

Each API key is limited to 10 requests per minute. The counter resets every 60 seconds. If you need higher limits, email c3po@ed-agent.com.

Get an API Key

API access is available to developers and businesses integrating C3PO education AI into their products.

Step 1 Purchase API credits via the payment page
Step 2 Email us and we'll issue your edagent_ key
Step 3 Start making API calls immediately
Purchase API Credits

Questions? Email c3po@ed-agent.com