Pareto Router API documentation.
The public selection API returns registry candidates and evidence by task. The execution API currently accepts code and text requests from signed-in browser sessions. Document, speech, and vision execution, developer API keys, and automatic fallback are planned.
Auth and tokens
Selection GET requests are public. Execution POST requests use the signed-in CodeSOTA browser session and require a configured provider. The current implementation grants a $10 starter balance. A signed-out execution request returns 401. Developer API keys and a usage-based billing contract are planned; the execution curl example needs a valid session cookie.
{
"error": "Sign in required.",
"sign_in_url": "https://www.codesota.com/sign-in?redirect_url=/pareto-router",
"sign_up_url": "https://www.codesota.com/sign-up?redirect_url=/pareto-router",
"starter_tokens_usd": 10
}Routing preferences
| SOTA | best: prioritize registry quality score. Execution uses configured provider routes. |
| Premium | balanced: combine registry quality and inferred affordability. Latency is not measured by this policy. |
| Economy | cheap: prioritize inferred affordability. No measured price ceiling or quality floor is enforced. |
Run a task
POST structured input for code and text execution. Use objective: best, balanced, or cheap. This example requires an authenticated session cookie; a public unauthenticated curl will return 401.
curl -X POST 'https://www.codesota.com/api/pareto-router' \
-H 'Content-Type: application/json' \
-d '{
"task": "code-debugging",
"objective": "best",
"input": {
"language": "typescript",
"goal": "Fix the bug and explain the change.",
"code": "function total(items) { return items.map(i => i.price).reduce((a, b) => a + b) }",
"error": "TypeError when items is empty"
},
"max_tokens": 900,
"temperature": 0.2
}'Decision mode
GET requests return ranking and route options without running a task. Use this for planning, previews, or server-side route selection.
curl 'https://www.codesota.com/api/pareto-router?task=code-generation&objective=balanced&limit=3'
Supported tasks
| document-ocr / document-parsing | Public model selection; execution planned |
| speech-recognition / text-to-speech | Public model selection; execution planned |
| image-classification / object-detection | Public model selection; execution planned |
| code-generation / question-answering | Model selection and configured code/text execution routes |
| Other registry tasks | Inspect supported_tasks from the API index; candidate availability varies |
Actual benchmark scatter plots and Pareto frontiers
Use the public benchmark endpoint to retrieve the exact observations behind the plots. Each comparison specifies both axes, whether to minimize or maximize each one, its source cohort, excluded observations, and the IDs on its Pareto frontier.
curl 'https://www.codesota.com/api/pareto-router/benchmarks?task=document-ocr'
Available families include OCR subtask comparisons, HumanEval versus MBPP, the English sentence-completion diagnostic, the stored Open ASR snapshot, and ImageNet score versus reported parameter counts. Model size is not a serving cost. Withdrawn TTS results are excluded. Cost and latency plots require auditable paired measurements.
A model is dominated only if another observation is at least as good on both axes and strictly better on one. Exact ties remain on the frontier. Reported benchmark settings may vary, and a point-estimate frontier does not establish statistical significance.
Response shape
Successful runs return generated text, configured route metadata, and the account balance after debit. The example below illustrates the shape; execution charges are configured estimates, not measured provider token usage. A selection shortlist can differ from the provider used for execution.
{
"service": "CodeSOTA Pareto Router",
"mode": "run",
"task": "code-generation",
"objective": "best",
"route": {
"profile": "Quality agentic coding route",
"route_id": "llm-route-1",
"estimated_cost_cents": 24
},
"output": {
"text": "..."
},
"account": {
"starter_tokens_usd": 10,
"balance_after_usd": 9.76
}
}