TechForAGI is designed for agents first. Every endpoint returns structured machine-readable data.
TechForAGI Gateway is an extension of Tech For People Global Corp’s agent-native product line.
# jump to section
quickstart · formats · endpoints · agent manifest · service catalog · quote · process · pricing · capabilities · payments · health · mcp · public examples · validation · deployment · agent workflow · seo/geo files# 1. discover available services
GET https://api.techforagi.com/services.json
# 2. estimate cost before processing
POST https://api.techforagi.com/quote
Content-Type: application/json
{
"service_id": "text.summarize",
"input_tokens_estimate": 500
}
# 3. process a request
POST https://api.techforagi.com/process
Content-Type: application/json
{
"service_id": "text.summarize",
"input": "TechForAGI Gateway provides machine-readable APIs for autonomous agents."
}
Set the Accept header to choose your format.
Use text/toon for LLM context windows (~40% fewer tokens).
Default. Standard JSON structure.
{
"meta": {
"request_id": "req_abc123",
"service_id": "text.summarize",
"format": "json",
"cost_usd": 0.001,
"latency_ms": 145,
"status": "ok"
},
"result": {
"summary": "This text discusses...",
"confidence": 0.92
}
}
~40% fewer tokens. YAML-style objects.
meta:
request_id: req_abc123
service_id: text.summarize
format: toon
cost_usd: 0.001
latency_ms: 145
status: ok
result:
summary: This text discusses...
confidence: 0.92
# request TOON format
POST https://api.techforagi.com/process
Accept: text/toon
Content-Type: application/json
{"service_id":"text.summarize","input":"Your text..."}
| method | path | description | format |
|---|---|---|---|
| GET | / | landing page | HTML |
| GET | /.well-known/agent.json | agent manifest | JSON |
| GET | /services.json | service catalog | JSON |
| GET | /services.toon | service catalog (compact) | TOON |
| GET | /services | services page | HTML |
| GET | /pricing.json | pricing metadata | JSON |
| GET | /pricing.toon | pricing metadata (compact) | TOON |
| GET | /capabilities.json | capability catalog | JSON |
| GET | /capabilities.toon | capability catalog (compact) | TOON |
| GET | /payments/future-contract.json | future payment contract | JSON |
| GET | /payments/future-contract.toon | future payment contract (compact) | TOON |
| GET | /health | health check | JSON |
| GET | /version | version metadata | JSON |
| POST | /quote | cost + latency estimate | JSON / TOON |
| POST | /process | run a service | JSON / TOON |
| POST | /mcp | MCP JSON-RPC 2.0 | JSON |
| GET | /openapi.json | OpenAPI 3.1 spec | JSON |
| GET | /llms.txt | LLM-readable summary | text/plain |
| GET | /robots.txt | crawler config | text/plain |
| GET | /sitemap.xml | XML sitemap | XML |
Agents should fetch this first. Describes the platform, available services, formats, discovery endpoints, and payment readiness.
{
"name": "TechForAGI Gateway",
"version": "0.3.6",
"phase": "phase-3-6-premium-deterministic-utilities",
"base_url": "https://techforagi.com",
"api_base_url": "https://api.techforagi.com",
"formats": ["application/json", "text/toon"],
"discovery": {
"services": "https://api.techforagi.com/services.toon",
"pricing": "https://api.techforagi.com/pricing.toon",
"capabilities": "https://api.techforagi.com/capabilities.toon",
"openapi": "https://api.techforagi.com/openapi.json",
"mcp": "https://api.techforagi.com/mcp",
"health": "https://api.techforagi.com/health",
"version": "https://api.techforagi.com/version",
"payment_contract": "https://api.techforagi.com/payments/future-contract.json"
},
"payment_readiness": {
"active": false,
"planned_protocols": ["x402", "credits", "api_key"],
"settlement_asset": "USDC"
},
"recommended_workflow": [
"GET https://techforagi.com/.well-known/agent.json",
"GET https://api.techforagi.com/services.toon",
"GET https://api.techforagi.com/pricing.toon",
"POST https://api.techforagi.com/quote",
"POST https://api.techforagi.com/process"
]
}
# TOON response
services[3]{id,name,description,input,output,price_usd,status}:
text.summarize,Text Summarize,Summarize text...,text,summary,0.001,active
doc.extract,Document Extract,Extract fields...,text,json/toon,0.004,active
knowledge.search,Knowledge Search,Search sources...,query,facts+sources,0.002,active
Estimate cost and latency before processing. All estimates are deterministic.
# request
{
"service_id": "text.summarize",
"input_tokens_estimate": 1200,
"format": "json"
}
# parameters
| field | type | req |
|---|---|---|
service_id | string | yes |
input_tokens_estimate | integer | yes |
format | json|toon | no |
# response
{
"service_id": "text.summarize",
"unit": "request",
"estimated_cost_usd": 0.0016,
"estimated_latency_ms": 420,
"currency": "USD",
"settlement_asset": "USDC",
"payment": {
"required_now": false,
"required_future": true,
"protocols_planned": ["x402","credits","api_key"],
"future_http_status": 402
}
}
An Agent Channel is a sandbox access path: agents self-register, receive a one-time bearer token
(tfagi_channel_test_...), call POST /process and MCP processing tools under quotas and rate limits.
No payment is required; billing_mode is functional_testing and
cost_usd is informational. Future x402/USDC settlement remains planned.
POST /agent-channels/register
Content-Type: application/json
{ "agent_name": "MyAgent", "payment_preference": { "mode": "sandbox", "settlement_asset": "USDC" } }
Response includes access_token once — store it securely. Never pass tokens in query strings.
Authorization: Bearer <access_token>
# or: X-Agent-Channel-Token: <access_token>
Daily/monthly request and informational cost caps apply per channel. Rate limits apply to registration (per IP) and execution (per channel). Responses may include RateLimit-* and quota fields in meta.
Only token hashes are stored. Revoke via POST /agent-channels/{id}/revoke. Optional POST /agent-channels/{id}/rotate-token issues a new token and revokes the old.
youtube.captions.get and youtube.video.formats are deprecated.
POST /process returns HTTP 410 Gone for those service_id values.
MCP tools get_youtube_captions and get_youtube_video_formats remain listed for discovery but tools/call returns a deprecation error.
Submit a processing task. Active execution: url.readability.extract, document.basic_extract; legacy mocks: deprecated Phase 1/2 IDs. YouTube service_ids return 410. Max input: 32,000 chars (structured inputs vary by service).
text.summarize
# request
{"service_id":"text.summarize","input":"Your long text here..."}
# response
{
"meta": {
"request_id": "req_abc123",
"service_id": "text.summarize",
"cost_usd": 0.001,
"latency_ms": 312,
"status": "ok"
},
"result": {
"summary": "This text discusses...",
"word_count": 45,
"confidence": 0.92,
"key_topics": ["autonomous","agents","services"]
}
}
doc.extract
{"service_id":"doc.extract","input":"Invoice 12/01/2025, $1,500.00 to billing@example.com"}
# result
{
"fields_found": 3,
"dates": ["12/01/2025"],
"emails": ["billing@example.com"],
"amounts": ["$1,500.00"],
"confidence": 0.88
}
knowledge.search
{"service_id":"knowledge.search","input":"what is MCP protocol"}
# result
{
"query": "what is MCP protocol",
"results_count": 3,
"results": [
{
"rank": 1,
"title": "Overview: what is mcp protocol",
"excerpt": "Trusted knowledge result...",
"source": "techforagi-knowledge-base",
"confidence": 0.91
}
]
}
# parameters
| field | type | required | notes |
|---|---|---|---|
service_id | string | yes | text.summarize | doc.extract | knowledge.search |
input | string | yes | max 32,000 chars |
format | json|toon | no | overrides Accept header |
MCP-compatible endpoint. Protocol: JSON-RPC 2.0. Supports: initialize, tools/list, tools/call.
# list tools
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
# call a tool
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "process_text",
"arguments": {
"input": "text to summarize..."
}
}
}
# available tools
| tool | description |
|---|---|
get_services | list all available services |
get_pricing | get pricing metadata per service |
get_capabilities | list all platform capabilities |
quote_service | estimate cost for a service call |
extract_url_readability | article text from URL (url.readability.extract) |
extract_document_basic | deterministic fields from text (document.basic_extract) |
get_youtube_captions | deprecated — tools/call returns an error |
get_youtube_video_formats | deprecated — tools/call returns an error |
process_text | summarize text (text.summarize) |
extract_document | extract fields from a document (doc.extract) |
search_knowledge | search knowledge sources (knowledge.search) |
get_payment_future_contract | get the future x402/USDC payment contract |
Per-service pricing metadata. No payment required in Phase 3.5. Exposed for discovery.
# TOON response
GET https://api.techforagi.com/pricing.toon
Accept: text/toon
pricing[3]{service_id,unit,price_usd,currency,settlement_asset,payment_required_now,...}:
text.summarize,request,0.001,USD,USDC,false,true,x402+credits+api_key,active
doc.extract,request,0.004,USD,USDC,false,true,x402+credits+api_key,active
knowledge.search,request,0.002,USD,USDC,false,true,x402+credits+api_key,active
# JSON response
GET https://api.techforagi.com/pricing.json
{
"total": 3,
"pricing": [
{
"service_id": "text.summarize",
"unit": "request",
"price_usd": 0.001,
"currency": "USD",
"settlement_asset": "USDC",
"payment_required_now": false,
"payment_required_future": true,
"payment_protocols_planned": ["x402","credits","api_key"]
}
]
}
16 platform capabilities describing what TechForAGI Gateway can do (see live /capabilities.toon for the exact set).
GET https://api.techforagi.com/capabilities.toon
Accept: text/toon
capabilities[16]{id,type,input,output,risk_level,services_using_it}:
youtube_captions_retrieval,media,youtube_url,captions+metadata,medium,youtube.captions.get (deprecated)
youtube_video_formats_listing,media,youtube_url,formats+signed_urls+metadata,high,youtube.video.formats (deprecated)
web_readability_extraction,web,public_url,text+metadata,medium,url.readability.extract
document_field_extraction,text,plain_text,structured_fields,low,document.basic_extract
web_metadata_audit,web,public_url,metadata_audit,low,web.metadata.audit
robots_policy_evaluation,compliance,url+user_agent,allow_disallow_policy,low,robots.policy.check
caption_transcript_parsing,text,caption_text,timed_segments,low,captions.parse
summarization,text,text,summary,low,text.summarize (deprecated)
entity_extraction,nlp,text,entities,low,doc.extract (deprecated)
knowledge_retrieval,search,query,facts+sources,medium,knowledge.search (deprecated)
cost_estimation,billing,service_id,quote,low,quote
format_negotiation,protocol,accept_header,response_format,low,all
mcp_tool_call,protocol,json_rpc,tool_result,medium,mcp
agent_discovery,discovery,http,manifest+catalog,low,agent.json+services
usage_metering,billing,service_call,usage_event,low,all
future_stablecoin_payment,billing,payment_proof,receipt,medium,planned
Future x402/USDC payment contract specification. Payments are not active in Phase 3.5. Read this contract to understand the planned payment flow.
GET https://api.techforagi.com/payments/future-contract.json
{
"active": false,
"protocol": "x402",
"settlement_asset": "USDC",
"chain": "Base",
"pricing_model": "per_request",
"payment_required_current": false,
"payment_required_future": true,
"flow": [
{ "step": 1, "action": "quote", "actor": "agent" },
{ "step": 2, "action": "return_estimate", "actor": "gateway" },
{ "step": 3, "action": "process_request", "actor": "agent" },
{ "step": 4, "action": "payment_required", "actor": "gateway" },
...
]
}
# health
GET https://api.techforagi.com/health
{
"status": "ok",
"service": "techforagi-gateway",
"version": "0.3.6",
"phase": "phase-3-6-premium-deterministic-utilities",
"timestamp": "2026-04-24T...",
"environment": "production"
}
# version
GET https://api.techforagi.com/version
{
"name": "techforagi-gateway",
"version": "0.3.6",
"phase": "phase-3-6-premium-deterministic-utilities",
"runtime": "cloudflare-workers",
"commit": "unknown"
}
# step 1: discover
MANIFEST=$(Invoke-WebRequest -Uri "https://api.techforagi.com/.well-known/agent.json")
# step 2: list services in TOON (compact for LLM context)
SERVICES=$(Invoke-WebRequest -Uri "https://api.techforagi.com/services.toon" `
-Headers @{Accept="text/toon"})
# step 3: quote before processing
QUOTE=$(Invoke-WebRequest -Uri "https://api.techforagi.com/quote" -Method POST `
-Body '{"service_id":"text.summarize","input_tokens_estimate":800}' `
-ContentType "application/json")
# step 4: process if cost is acceptable
RESULT=$(Invoke-WebRequest -Uri "https://api.techforagi.com/process" -Method POST `
-Headers @{Accept="text/toon";"Content-Type"="application/json"} `
-Body '{"service_id":"text.summarize","input":"Long document text..."}')
# step 5: parse request_id from meta block for audit trail
# meta.request_id: req_xxxxxx
# meta.cost_usd: 0.001
# meta.status: ok
Phase 3.5 publishes public examples for external agents and developers. These files are static, cacheable, and safe to fetch before calling live endpoints.
| path | purpose |
|---|---|
/examples | human-readable integration overview |
/examples/agent-workflow.toon | compact agent workflow |
/examples/agent-workflow.json | JSON workflow for clients |
/examples/curl | copyable curl commands |
/examples/mcp | MCP JSON-RPC request examples |
/for-agents | agent-focused integration guidance |
/for-developers | developer validation guidance |
/security | security posture and current constraints |
Smoke tests verify public endpoints over HTTP. Start Wrangler before running local smoke tests.
# local validation
npm run dev
npm run smoke
npm run validate:openapi
# deployed validation
BASE_URL=https://api.techforagi.com npm run smoke
PUBLIC_BASE_URL=https://api.techforagi.com npm run validate:public
| step | check |
|---|---|
| 1 | Set BASE_URL and API_BASE_URL in wrangler.toml. |
| 2 | Run npm test and npm run typecheck. |
| 3 | Run npm run dev, then npm run smoke. |
| 4 | Deploy with npm run deploy. |
| 5 | Attach custom domain routes in Cloudflare Workers. |
| 6 | Run PUBLIC_BASE_URL=https://api.example.com npm run validate:public. |
# Phase 3.5: optional Supabase (metering, Agent Channels). No card or on-chain settlement yet.
| path | purpose |
|---|---|
/robots.txt | allow all crawlers + sitemap reference |
/sitemap.xml | all public URLs for search indexing |
/llms.txt | GEO: LLM-readable plain text summary for generative search |
/.well-known/agent.json | agent discovery manifest |
/openapi.json | OpenAPI 3.1 specification |