API

UPEC API reference

The authoritative compiler is the Rust/Axum UPEC backend. The Next.js application reaches it through a same-origin server-side proxy.

Authentication

Registration and login use email and password. Successful authentication returns a bearer session token and an organization id. The application proxy stores browser session context in httpOnly cookies and forwards the bearer token server-side.

POST /api/auth/register
POST /api/auth/login
POST /api/auth/logout
GET /api/me

Premium compile

POST /api/premium/compile compiles the problem model and returns classification, strategy, diagnostics, done-state, execution contract, explainability, hashes and the final compiled prompt in one response.

curl -X POST https://<your-upec-host>/api/premium/compile \
  -H "authorization: Bearer <UPEC_TOKEN>" \
  -H "content-type: application/json" \
  -d '{
    "problem": "Checkout returns 500 under load",
    "goal": "Keep p99 < 400ms at 2x peak",
    "target": "coding_agent",
    "risk": "medium",
    "accuracy_profile": "verified",
    "permissions": ["read_only", "edit"],
    "success_criteria": ["Zero 500s in load test"]
  }'
fieldtypedescription
quality_scorenumberDeterministic 0–100 quality score
readinessstringReady | NeedsPermission | Blocked | Unverified
done_statestringDone | Partial | Blocked | Unverified
compiled_promptstringRendered target-specific AI specification
source_hashstringIntegrity hash for normalized source material
prompt_hashstringIntegrity hash for the compiled prompt
build_fingerprintstringDeterministic compilation fingerprint
lint_issues[]objectStructured code, severity and message
execution_contractobjectTarget/tool/permission execution decision

Bring your own key

Provider API keys (BYOK)

Open Providers workspace

UPEC does not provide or resell OpenAI, Anthropic or Gemini API keys. Create the key in your own provider account, enable provider billing there when required, and then save that credential in UPEC.

OpenAI

Create or manage an OpenAI Platform API key in your own OpenAI account.

Get API key ↗

Anthropic / Claude

Create or manage a Claude Platform API key in your own Anthropic account.

Get API key ↗

Google Gemini

Create or manage a Gemini API key in Google AI Studio.

Get API key ↗

How a customer connects a provider

  1. 1. Open the official provider portal above and create a provider API key.
  2. 2. Add billing or credits in that provider account if the provider requires it.
  3. 3. Open UPEC → Providers and create the matching provider connection.
  4. 4. Paste the provider key into UPEC's encrypted credential vault.
  5. 5. Run a provider test only when you explicitly want to make that provider call.