Publishing a Circuit as an API
Let others call your circuit with their own API key.
From your Dashboard, choose Publish as API. Give it a name, a URL name and an OpenQASM circuit. Wherever a caller should supply a number, write a placeholder:
ry({{theta}}) q[0];For each placeholder, set a default and the allowed range. Callers can only send numbers in that range, never circuit code.
Callers use their API key:
curl -X POST "https://quantum-hub.app/gw/apis/<url-name>/run?wait=20" \
-H "Authorization: Bearer qh_..." -H "Content-Type: application/json" \
-d '{"params": {"theta": 1.57}, "shots": 500}'- Each call runs on the simulator as the caller's job, so it shows on their Jobs page and counts toward their limits.
- Callers get the measurement counts, not your circuit.
- Your Dashboard shows how many times each API was called. You can unpublish and republish at any time.