██████╗ ██████╗ ██╗ ██╔═══██╗██╔══██╗██║ ██║ ██║██████╔╝██║ ██║▄▄ ██║██╔═══╝ ██║ ╚██████╔╝██║ ██║ ╚══▀▀═╝ ╚═╝ ╚═╝
QPI JavaScript/TypeScript Client
JavaScript/TypeScript client SDK for the QPI quantum computing platform.
Zero runtime dependencies — uses the global fetch API.
Install
npm install qpi-client
Requires Node.js ≥ 18 (or any environment with a global fetch).
Quick Start
import { QPIClient } from "qpi-client";
const client = new QPIClient({
baseUrl: "http://localhost:8090",
apiToken: "my-api-token",
});
// Submit a job
const jobId = await client.submitJob({
circuits: [
{
circuit: `OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
h q[0];
cx q[0], q[1];
c = measure q;`,
},
],
shots: 1024,
});
console.log("Job ID:", jobId);
// Wait for completion
const result = await client.waitForJob(jobId);
console.log("Status:", result.status);
console.log("Results:", result.results);
API Overview
| Method | Description |
|---|---|
new QPIClient({ baseUrl, apiToken }) |
Create a new client |
submitJob(request) |
Submit a quantum job |
getJob(jobId) |
Retrieve a job by ID |
listJobs() |
List all jobs for the authenticated user |
cancelJob(jobId) |
Request job cancellation |
waitForJob(jobId, options?) |
Poll until the job reaches a terminal state |
listQpus() |
List all online QPUs |
getQpu(name) |
Retrieve a single QPU |
createQpu(request) |
Create a new QPU record (admin) |
connectQpu(request) |
Connect a QPU driver node |
listTimeSlots() |
List booking slots |
listNotifications() |
List visible notifications |
TypeScript
Full type definitions are included. All request/response types are exported:
import type {
QPIClientOptions,
CircuitPayload,
JobSubmitRequest,
JobRecord,
} from "qpi-client";
Documentation
License
MIT — see the main repository for details.