Developers
ScodyX AI API
Three endpoints and five products. You choose the outcome; ScodyX routes it, escalates on failure, and meters it against your existing credit balance. Vendor model names are never part of the contract, so routing can improve without breaking your integration.
Authentication
Create a key in your workspace settings and send it as a bearer token. Keys are scoped: AI endpoints need the write scope.
Authorization: Bearer ax_live_your_key_here
Content-Type: application/jsonProducts
fireScodyX Fire— Flash speed for the work you do a thousand times a day.scholarScodyX Scholar— The optimised default. Best result per credit for everyday building.advancedScodyX Advanced— Heavy work: architecture, migrations, security, whole-system change.visionScodyX Vision— Anything with eyes: screenshots, layouts, visual proof, browser work.sentinelScodyX Sentinel— The second opinion. Review, security audit and acceptance judging.
GET /api/public/v1/ai/products returns this list with live rates and needs no key.
POST /api/public/v1/ai/completions
The general endpoint. Send prompt or a messages array. Set stream: true for server-sent events.
curl https://scodyx.com/api/public/v1/ai/completions \
-H "Authorization: Bearer ax_live_..." \
-H "Content-Type: application/json" \
-d '{
"product": "scholar",
"prompt": "Explain what this migration will do to existing rows.",
"task": "explain",
"risk": 40
}'{
"id": "3f0c…",
"product": "scholar",
"output": "…",
"usage": { "input_tokens": 812, "output_tokens": 430, "credits": 0.04 },
"routing": { "reason": "Everyday build work, routed for balance of quality and cost." }
}POST /api/public/v1/ai/code
Code generation and editing. Defaults to Scholar; Advanced is accepted for migrations, authentication and architecture. Fire is refused here with a product_not_allowed error naming the product to use instead — a product that may not touch code cannot be handed code through another door.
{ "product": "advanced", "prompt": "Add row-level security to the invoices table.", "task": "migration" }POST /api/public/v1/ai/review
Independent review, security reading and acceptance judgement. Always served by Sentinel, which never runs on ScodyX's own weights and never on the family that wrote the code under review.
{ "prompt": "Review this diff for authorisation gaps.\n\n<diff>" }Streaming
With stream: true you receive delta events as text arrives, then one done event carrying usage and routing, or an error event. Long runs always stream on the wire, so a slow generation is never cut off.
event: delta
data: {"text":"export function "}
event: done
data: {"id":"3f0c…","usage":{"credits":0.11}}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_body / unknown_product / empty_input | Fix the request before resending. |
| 401 | missing_api_key / invalid_api_key | The key is absent, wrong or revoked. |
| 402 | insufficient_credits | Top up the workspace balance. |
| 403 | insufficient_scope / forbidden | The key lacks the write scope, or policy blocks it. |
| 413 | input_too_large | Split the input into smaller requests. |
| 429 | rate_limited | Retryable — wait, then retry with backoff. |
| 502 | upstream_unavailable | Retryable — every family was unreachable. |
Metering
Every response carries its own usage. Credits are charged per million tokens at the product rate, less your tier's discount, against the same balance the builder uses. See ScodyX AI for rates and tiers.
GET /api/public/v1/usage returns your credit movements by day, engine and project.