API v1 · @uqp/sdk 1.0.0

Developer interface

One versioned API surface across every engine. A key is scoped to exactly one application and environment; every route enforces its scope, rate limit and quota server-side.

Endpoints

29 routes under /api/public/v1

  • POST/api/public/v1/queryquery:write

    Run a query through context → routing → tools → verification.

    uqp.query.run(request)
  • POST/api/public/v1/contextcontext:read

    Assemble a budgeted, deduplicated context pack.

    uqp.context.assemble(request)
  • GET/api/public/v1/context/packs/{id}context:read

    Replay a persisted context pack.

    uqp.context.getPack(id)
  • GET/api/public/v1/memory/memory:read

    List memories for the application or an external user.

    uqp.memory.list()
  • POST/api/public/v1/memory/memory:write

    Create a memory and queue its embedding.

    uqp.memory.create(request)
  • POST/api/public/v1/memory/searchmemory:read

    Hybrid lexical + vector memory search.

    uqp.memory.search(request)
  • GET/api/public/v1/knowledge/basesknowledge:read

    List knowledge bases.

    uqp.knowledge.listBases()
  • POST/api/public/v1/knowledge/documentsknowledge:write

    Register a document and queue durable ingestion.

    uqp.knowledge.ingest(request)
  • POST/api/public/v1/knowledge/searchknowledge:read

    Hybrid chunk retrieval with provenance.

    uqp.knowledge.search(request)
  • GET/api/public/v1/modelsany valid key

    Model registry plus configured provider adapters.

    uqp.models.list()
  • GET/api/public/v1/agents/agents:read

    List agents in the application/environment.

    uqp.agents.list()
  • POST/api/public/v1/agents/{id}/runsagents:execute

    Start a durable agent run.

    uqp.agents.run(id, { goal })
  • GET/api/public/v1/workflows/workflows:read

    List workflow definitions.

    uqp.workflows.list()
  • POST/api/public/v1/workflows/{id}/runsworkflows:execute

    Start a workflow run.

    uqp.workflows.run(id, input)
  • POST/api/public/v1/workflows/approvals/{id}workflows:execute

    Record a decision on a suspended approval node.

    uqp.workflows.decideApproval(id, decision)
  • GET/api/public/v1/tools/tools:read

    List registered tools and their capabilities.

    uqp.tools.list()
  • POST/api/public/v1/tools/{id}/executetools:execute

    Invoke a tool through its protocol provider.

    uqp.tools.execute(id, { args })
  • GET/api/public/v1/executions/any valid key

    Cursor-paginated execution ledger.

    uqp.executions.list()
  • GET/api/public/v1/executions/{id}any valid key

    Execution detail with steps, children and events.

    uqp.executions.get(id, ['children'])
  • GET/api/public/v1/executions/{id}/streamany valid key

    Server-sent status stream until the execution is terminal.

    uqp.executions.stream(id)
  • POST/api/public/v1/executions/{id}/cancelquery:write

    Cooperatively cancel a running execution.

    uqp.executions.cancel(id)
  • GET/api/public/v1/executions/{id}/verificationsany valid key

    Verification records written against an execution.

    uqp.verification.forExecution(id)
  • POST/api/public/v1/events/events:write

    Ingest an event for normalisation, dedupe and rule matching.

    uqp.events.ingest(payload)
  • GET/api/public/v1/approvals/approvals:read

    List governance approval gates.

    uqp.approvals.list()
  • POST/api/public/v1/approvals/{id}approvals:write

    Approve or deny a pending approval gate.

    uqp.approvals.decide(id, { decision })
  • POST/api/public/v1/policies/simulatepolicies:read

    Dry-run a policy decision without side effects.

    uqp.policies.simulate(input)
  • GET/api/public/v1/observabilityobservability:read

    Hourly rollups, latency and error taxonomy.

    uqp.observability.metrics()
  • GET/api/public/v1/usageusage:read

    Daily usage, cost and quota state.

    uqp.usage.get()
  • GET/api/public/v1/healthany valid key

    Service and provider-adapter health.

    uqp.health()

Error taxonomy

Every failure returns the same envelope

{ "error": { "code": "rate_limited", "message": "Rate limit exceeded",
            "status": 429, "request_id": "req_9f2c…" } }
codehttpmeaning
validation400Request body or parameters failed schema validation.
authentication401Missing, invalid or revoked API key.
forbidden403The key is missing the scope the route requires.
policy_denied403The policy engine denied the action.
rate_limited429Per-key request budget exhausted. Honour Retry-After.
quota_exceeded429Application quota for the category is spent.
provider_error502A model provider failed.
tool_error502A tool provider failed.
timeout504The execution exceeded its deadline.
internal500Unexpected server fault; safe to retry idempotently.

Official SDK

@uqp/sdk — typed client for this exact contract

import { UQP } from "@uqp/sdk";

const uqp = new UQP({ apiKey: process.env.UQP_API_KEY! });

const result = await uqp.query.run({
  input: "Find the best hotel for this user's upcoming London trip.",
  sources: ["user_profile", "preferences", "recent_activity"],
  tools: ["hotel.search", "web.search"],
  model: "auto",
  verify: true,
});

console.log(result.execution_id, result.status);

Conventions

The rules every endpoint follows

  • Authorization: Bearer … — or x-uqp-key. The key resolves the tenant; no application id is ever sent.
  • Idempotency-Key — mutating calls replay the original execution instead of running twice.
  • Durable work returns 202 with an execution_id; poll /executions/{id} or subscribe to its SSE stream.
  • Lists page with ?cursor=&limit= and return next_cursor.
  • Responses carry x-request-id and rate-limit headers; quote the request id in support requests.

Scopes

Granted per API key, enforced per route

query:writecontext:readmemory:readmemory:writeknowledge:readknowledge:writeagents:readagents:executeworkflows:readworkflows:writeworkflows:executetools:readtools:writetools:executeevents:readevents:writeapprovals:readapprovals:writepolicies:readpolicies:writeobservability:readusage:read