Skip to content

Commit 36b4f09

Browse files
committed
Sync OpenAPI: add clone and artifact endpoints, replace CostModel
Regenerate the client against the upstream v0.4 spec (issue #52). - Add clone_job (POST /jobs/{UUID}/clone) and CloneJobPayload. - Replace get_compiled_file (GET /jobs/{UUID}/circuits/{lang}) with get_job_artifact (GET /jobs/{UUID}/artifacts/{artifactId}); the response body is opaque, so only the *_detailed callables are generated. - Replace CostModel with ApiCostModel ("QCT" / "2QGE_operations"). - Add Backend.supported_gates/supported_native_gates/supported_error_mitigations. - Add estimate_job_cost fields: estimated_quantum_compute_time_us, plus rate_information.qct_cost_cents and rate_type; cost fields now nullable. - Update tests, AGENTS.md, and CHANGELOG accordingly.
1 parent c697a8d commit 36b4f09

29 files changed

Lines changed: 1378 additions & 127 deletions

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ Every endpoint module exposes four callables: `sync`, `sync_detailed`, `asyncio`
7575

7676
```python
7777
from ionq_core import IonQClient
78-
from ionq_core.api.default import create_job, get_job, get_compiled_file, get_jobs
78+
from ionq_core.api.default import create_job, get_job, get_variant_probabilities, get_jobs
7979
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload
8080

8181
client = IonQClient() # reads IONQ_API_KEY
8282
get_job.sync(uuid, client=client) # one path param
83-
get_compiled_file.sync(uuid, lang, client=client) # multiple path params
83+
get_variant_probabilities.sync(uuid, variant_id, client=client) # multiple path params
8484
get_jobs.sync(client=client, status="completed", limit=10) # query only
8585
create_job.sync(client=client, body=payload) # body only
8686
```

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
99
### Added
1010

1111
- `QctrlQaoaJobCreationPayload` and `QctrlQaoaJobInput` for submitting Q-CTRL QAOA maxcut combinatorial-optimization jobs via `create_job`. The `create_job` body union now also accepts `QctrlQaoaJobCreationPayload`.
12-
- `cost_model` optional field on `BaseJob`, `GetCircuitJobResponse`, and `GetJobResponse`, typed as `CostModel` (`"quantum_compute_time"` or `"execution_time"`).
12+
- `cost_model` optional field on `BaseJob`, `GetCircuitJobResponse`, and `GetJobResponse`, typed as `ApiCostModel` (`"QCT"` or `"2QGE_operations"`).
13+
- `clone_job` endpoint (`POST /jobs/{UUID}/clone`) and its `CloneJobPayload` model for resubmitting an existing job with optional overrides.
14+
- `get_job_artifact` endpoint (`GET /jobs/{UUID}/artifacts/{artifactId}`) for downloading job artifacts by id. The response body is opaque, so only the `sync_detailed` / `asyncio_detailed` callables are generated; read the bytes off `Response.content`.
15+
- `Backend` now exposes `supported_gates`, `supported_native_gates`, and `supported_error_mitigations`.
16+
- `estimate_job_cost` response gained `estimated_quantum_compute_time_us`, and its `rate_information` gained `qct_cost_cents` and `rate_type` (`"qct"` or `"2qge"`). Its `cost_1q_gate`, `cost_2q_gate`, and `job_cost_minimum` rate fields are now nullable.
1317

1418
### Changed
1519

1620
- `NativeCircuitInput.qubits` and `JsonMultiCircuitInput.qubits` are now `int | Unset` (previously `float | Unset`), matching upstream's tightening to `format: int32, minimum: 1`. `QisCircuitInput.qubits` already had this type locally via the OpenAPI overlay; that overlay action has been removed now that upstream is correct natively.
1721

22+
### Removed
23+
24+
- `get_compiled_file` endpoint (`GET /jobs/{UUID}/circuits/{lang}`) and its `GetCompiledFileLang` enum, removed upstream in favor of `get_job_artifact`. Compiled circuits are now fetched as artifacts by id rather than by `lang` (`"native"` / `"qasm3"`).
25+
- `CostModel` model, replaced by `ApiCostModel`.
26+
1827
## [0.1.1] - 2026-04-30
1928

2029
### Changed

ionq_core/api/default/get_compiled_file.py renamed to ionq_core/api/default/clone_job.py

Lines changed: 39 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ionq_core/api/default/get_job_artifact.py

Lines changed: 129 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)