The playground exposes four HTTP endpoints underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/itsubaki/qasm-playground/llms.txt
Use this file to discover all available pages before exploring further.
/api. Every endpoint accepts JSON and returns JSON. All four endpoints proxy requests to the quasar service running on Google Cloud Run, using the GOOGLE_CLOUD_SERVICE_URL environment variable.
POST /api/simulate
Submit OpenQASM 3.0 source code and receive the quantum state vector produced by the simulator. The response lists every basis state with nonzero probability, along with its probability and complex amplitude.Request
The full OpenQASM 3.0 program to simulate, including the
OPENQASM 3.0; version declaration.Response
Array of quantum basis states with nonzero probability after simulation.
Errors
| Status | Meaning |
|---|---|
| 400 | The code field is missing, or the simulator rejected the program as invalid OpenQASM. |
| 503 | The quasar backend service is unavailable. |
| 500 | The GOOGLE_CLOUD_SERVICE_URL environment variable is not set, or an unexpected server error occurred. |
POST /api/share
Save an OpenQASM program and receive a shareable snippet ID. The returned ID can be passed to/api/edit to retrieve the program later.
Request
The OpenQASM 3.0 program to save. The full source is stored as-is.
Response
Unique identifier for the saved snippet. Use this ID to retrieve the snippet via
/api/edit.The program source that was saved.
ISO 8601 timestamp of when the snippet was created.
Errors
| Status | Meaning |
|---|---|
| 400 | The code field is missing from the request body. |
| 500 | The GOOGLE_CLOUD_SERVICE_URL environment variable is not set, or an unexpected server error occurred. |
POST /api/edit
Retrieve a previously saved snippet by its ID. This is used by the playground to load shared programs from a URL.Request
The snippet ID returned by a prior call to
/api/share.Response
The snippet ID.
The saved OpenQASM program source.
ISO 8601 timestamp of when the snippet was originally created.
Errors
| Status | Meaning |
|---|---|
| 400 | The id field is missing from the request body. |
| 500 | The GOOGLE_CLOUD_SERVICE_URL environment variable is not set, the snippet was not found, or an unexpected server error occurred. |
POST /api/validate
Check whether an OpenQASM program is syntactically valid without running a full simulation. Returns the validation result from the simulator backend.Request
The OpenQASM 3.0 program to validate.
Response
The response body is the raw validation result returned by the quasar service. A successful validation returns an HTTP 200 with a JSON body indicating the program is valid.Errors
| Status | Meaning |
|---|---|
| 400 | The code field is missing, or the program contains a syntax error detected by the validator. The response body includes the error message from the simulator. |
| 500 | The GOOGLE_CLOUD_SERVICE_URL environment variable is not set, or an unexpected server error occurred. |