Skip to navigation

API tokens

A Control API token lets your scripts list labs, discover experiments, submit and cancel jobs, and read results without a browser session. It acts as you, within the lab and scopes you give it.

Control API tokens start with cqk_. The deprecated Models product uses Models API keys for the conductorquantum SDK and hosted analysis models. The Conductor CLI uses a separate login to connect your instrument client or qm-qua to your lab.

Create a token

  1. Open API tokens in Control and sign in.

  2. Under Create API token, enter a Name that says where the token will be used.

  3. Choose the Lab the token may use.

  4. Select its Scopes. For lab and job operations, choose only what your script needs:

    ScopeAllows
    Read labs (labs:read)List the token’s labs
    Read jobs (jobs:read)List the experiment catalog, list jobs, and read a job
    Submit and cancel jobs (jobs:submit)Submit and cancel jobs, and list the experiment catalog

    To list labs only, select Read labs and clear the other scopes.

  5. Choose an Expiry: 30 days, 90 days, or never.

  6. Select Create API token, then copy the token. It is shown only once; Control stores only its hash.

Create API token form for North Hall Qubit Lab with Read labs, Read jobs, and Submit and cancel jobs selected. The token list is empty.
Choosing token permissions for a simulated lab before creating the token.

Store the token in a secret manager or an environment variable, never in code or a notebook you share. A token can do only what you can: if you lose access to its lab, the token loses it too.

Use the token

Set CONTROL_API_TOKEN securely in your shell environment. Send it as a bearer token. For example, list your labs:

curl -H "Authorization: Bearer $CONTROL_API_TOKEN" \
https://control.conductorquantum.com/api/v1/labs

Look up the experiments you can run and their parameters:

curl -H "Authorization: Bearer $CONTROL_API_TOKEN" \
https://control.conductorquantum.com/api/v1/experiments

Before you submit a job, check the lab, targets, and parameters against your approved hardware limits. Set LAB_ID to the lab’s ID. Generate one key for this submission:

JOB_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"

Run the request only when authorized. For a retry within 24 hours, use the same key and identical request body. Do not regenerate the key for that retry.

curl -X POST \
-H "Authorization: Bearer $CONTROL_API_TOKEN" \
-H "Idempotency-Key: $JOB_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"workflow","procedure":"single_qubit_bringup","targets":["Q0"]}' \
"https://control.conductorquantum.com/api/v1/labs/$LAB_ID/jobs"

Set JOB_ID to the returned job’s id. To check its status, run:

curl -H "Authorization: Bearer $CONTROL_API_TOKEN" \
"https://control.conductorquantum.com/api/v1/jobs/$JOB_ID"

A job’s status says whether it finished running; scientific_success says whether its result passed acceptance. See Get a job for scopes and responses.

A submitted job can operate real hardware. Check its targets and parameters before submitting, and inspect a job’s recorded outcome before retrying it.

Revoke a token

Open API tokens, find the token in the list, and select Revoke. Requests with it fail at once with 401. The list also shows when each token was last used and when it expires; revoke any token you no longer use, and replace a token you think was exposed.