REST Workflow Guide¶
REST is not part of the hosted product today
The hosted product is reached over MCP. Every /api/v1/* route documented on this page is closed at the edge: the production nginx config answers location /api/ with 404 (see infra/nginx/conf.d.prod/g6solver.conf). The examples below will not work against g6solver.com — they are kept as engineering reference for the REST base in this repository, not as customer instructions.
Run the Business Document Classifier programmatically via G6's REST API.
Prerequisites¶
Base URL¶
Step-by-step¶
Step 1: Health check¶
Expected response:
Step 2: Decompose goal¶
curl -X POST http://localhost:8010/api/v1/goals/decompose \
-H "Content-Type: application/json" \
-d '{
"goal": "Classify support tickets into categories",
"context": "5 categories: billing, technical_support, account_access, feature_request, complaint",
"constraints": ["Target accuracy: 80%", "Use held-out evaluation"]
}'
r = httpx.post("http://localhost:8010/api/v1/goals/decompose", json={
"goal": "Classify support tickets into categories",
"context": "5 categories: billing, technical_support, account_access, feature_request, complaint",
"constraints": ["Target accuracy: 80%", "Use held-out evaluation"],
})
plan = r.json()
Step 3: Invoke evaluation component¶
curl -X POST http://localhost:8010/api/v1/invoke \
-H "Content-Type: application/json" \
-d '{
"component": "align_evals",
"op": "infer",
"params": {
"predictions": ["billing", "complaint", "technical_support"],
"ground_truth": ["billing", "billing", "technical_support"],
"metrics": ["accuracy", "precision", "recall", "f1"],
"threshold": 0.8
}
}'
r = httpx.post("http://localhost:8010/api/v1/invoke", json={
"component": "align_evals",
"op": "infer",
"params": {
"predictions": ["billing", "complaint", "technical_support"],
"ground_truth": ["billing", "billing", "technical_support"],
"metrics": ["accuracy", "precision", "recall", "f1"],
"threshold": 0.8,
},
})
eval_result = r.json()
# {"scores": {"accuracy": 0.67, ...}, "passed": false, "degraded": false}
Step 4: Run a pipeline¶
curl -X POST http://localhost:8010/api/v1/pipeline \
-H "Content-Type: application/json" \
-d '{
"steps": [
{"component": "adapt_pandas", "op": "load_csv", "params": {"path": "data.csv"}},
{"component": "align_evals", "op": "infer", "params": {"metrics": ["accuracy", "f1"]}}
],
"budget": {"max_tokens": 10000, "max_seconds": 60}
}'
r = httpx.post("http://localhost:8010/api/v1/pipeline", json={
"steps": [
{"component": "adapt_pandas", "op": "load_csv", "params": {"path": "data.csv"}},
{"component": "align_evals", "op": "infer", "params": {"metrics": ["accuracy", "f1"]}},
],
"budget": {"max_tokens": 10000, "max_seconds": 60},
})
pipeline_result = r.json()
Step 5: Get recommendations¶
Step 6: Run self-training audit¶
Response format¶
All responses follow:
{
"ok": true,
"result": { ... },
"meta": {
"duration_ms": 142,
"tokens_used": 0,
"degraded": false
}
}
Error responses:
Authentication¶
For production deployments, include your API key:
See Configuration for auth setup.
Rate limits¶
| Tier | Requests/min | Tokens/hour |
|---|---|---|
| Free Trial | 10 | 5,000 |
| Researcher | 60 | 50,000 |
| Builder | 300 | 500,000 |
Next steps¶
- MCP guide for interactive Claude Code workflow
- Web onboarding for browser-based account management
- API Reference for complete endpoint documentation