Router Docs
Guides

Quickstart

This guide takes you from nothing to a circuit run on the Amazon Braket SV1 simulator through the router, with eigenkit or with plain HTTP.

1. Install eigenkit with the router client

TerminalCode
pip install "eigenkit[router]"

The router extra of eigenkit installs the router client. New router features ship in the client, so upgrade it by name:

TerminalCode
pip install -U eigenorbit-router-client

You need nothing extra for HTTP: every call below is a curl command.

2. Create an API key

  1. Sign in to the router web app at https://router.eigenorbit.com and accept the router terms.
  2. Add funds on the Balance page. SV1 is an Amazon Braket device, so its jobs are paid from your balance.
  3. Create an API key on the Keys page. The key is shown once: copy it then.

A job on SV1 holds 90000 micro-USD of your balance while it runs. Amounts are integers in micro-USD, so that is 90000 / 1000000 = $0.09. A short job is then charged 4500 ($0.0045) and the rest of the hold comes back. See Balance, holds and charges.

3. Put the key in an environment variable

TerminalCode
export EIGENORBIT_ROUTER_API_KEY=eo_live_...

eigenkit reads the key from EIGENORBIT_ROUTER_API_KEY when RouterConfig(api_key=...) is not set. The curl commands below read it from the same variable.

4. Run a circuit on braket/sv1

import numpy as np from eigenkit import Circuit from eigenkit.core.blocks import ( AngleEncoding, BasicVariational, assemble, ) from eigenkit.core.observables import all_z from eigenorbit_router_client import RouterConfig spec = assemble([ AngleEncoding(in_features=2), BasicVariational(depth=1), ]) # The API key is read from EIGENORBIT_ROUTER_API_KEY. # On a real QPU: device="braket/iqm_garnet" (see Devices) provider = RouterConfig(device="braket/sv1", shots=1000) circuit = Circuit(spec, all_z(2), provider=provider) weights = np.linspace(-0.9, 1.1, spec.n_weights) inputs = np.array([0.2, 0.6]) values = circuit(weights, inputs) # one router job print(values)

With eigenkit, building the circuit asks the router for an estimate and shows one CostWarning with the price of a job. The call circuit(weights, inputs) then sends one job and blocks until it finishes.

Over HTTP, the body is a one-qubit circuit RY(w0) measured with Z0, with shots 0 for an exact result. eigenkit produces circuit_spec and observables in this form; their format is not specified for hand-written requests. The router answers 202 with the new job:

JSONCode
{ "id": "01a0d3c5-6d70-7894-b00c-bf5998ca19fa", "status": "queued", "billing": "held", "device": "braket/sv1", "method": "run", "shots": 0, "estimate_usd_micro": 90000, "price_version": "braket/sv1@1", "error": null, "actual_cost_usd_micro": null, "vendor_cost_usd_micro": null, "fee_usd_micro": null, "created_at": "2026-09-24T14:12:03.512000Z", "updated_at": "2026-09-24T14:12:03.512000Z", "completed_at": null, "result_expires_at": null, "credential_source": null, "ibm_usage_seconds": null }

5. Read the result

With eigenkit, values holds one expectation value per observable, as on any other eigenkit provider. sample(...) and probabilities(...) work as well.

Over HTTP, poll the job until its status is completed, then read the result. Asking for the result earlier answers 409 job_not_completed. Use the id from the answer above:

TerminalCode
JOB_ID=01a0d3c5-6d70-7894-b00c-bf5998ca19fa curl https://router.eigenorbit.com/v1/jobs/$JOB_ID \ --header 'EO-Protocol-Version: 1' \ --header "Authorization: Bearer $EIGENORBIT_ROUTER_API_KEY" curl https://router.eigenorbit.com/v1/jobs/$JOB_ID/result \ --header 'EO-Protocol-Version: 1' \ --header "Authorization: Bearer $EIGENORBIT_ROUTER_API_KEY"

The result of a run job is one expectation value per observable, as a float64 array:

JSONCode
{ "job_id": "01a0d3c5-6d70-7894-b00c-bf5998ca19fa", "method": "run", "bit_order": "qubit0_msb", "result": { "kind": "array", "dtype": "float64", "shape": [1], "data": [0.8775825618903728] } }

The answer also carries execution, which this example omits: what the router ran on the vendor, for SV1 the Amazon Braket task ID. See Job lifecycle.

Next steps

Reference

Last modified on