Programs
Endpoints related to Qiskit Runtime programs
Add a program
Upload a new quantum program.
Body Parameters (application/json)
Name, Type | Description |
---|---|
name Required string | Program name |
cost integer | Cost of the program as the estimated time it should take to complete (in seconds) Default Value: 600 |
description string | Program description to help others understand the purpose of this program |
spec | Program information relevant to running this program |
Tags string[] | List of job or program tags |
is_public boolean | Indicates whether the program is public or private Default Value: false |
data Required string | The program text to upload, as a base64 encoded string |
HTTP Response Status Codes
Status code | Description |
---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
Code samples
curl -X POST \
-H "x-access-token: <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d {"name":"name","data":"data"} \
https://runtime-us-east.quantum-computing.ibm.com/programs
Responses
{
"id": "sample-program-abcdef123456",
"name": "sample-program",
"cost": 18000,
"description": "A sample runtime program",
"creation_date": "2021-05-10T08:59:51Z",
"update_date": "2021-06-04T14:11:19Z",
"spec": {
"backend_requirements": {
"min_num_qubits": 5
},
"parameters": {
"properties": {
"iterations": {
"description": "Number of iterations to run. Each iteration generates and runs a random circuit.",
"type": "integer",
"minimum": 0
}
},
"$schema": "https://json-schema.org/draft/2019-09/schema",
"required": [
"iterations"
]
},
"return_values": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"result": {
"description": "A string that says \"All done!\"",
"type": "string"
}
}
},
"interim_results": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"iteration": {
"type": "integer",
"description": "Iteration number"
},
"counts": {
"type": "object",
"description": "Histogram data of the circuit result"
}
}
}
},
"is_public": true,
"tags": [
"tag1",
"tag2",
"tag3"
]
}
{
"title": "ProgramResponse",
"allOf": [
{
"title": "ProgramMetadata",
"allOf": [
{
"title": "ProgramUpdate",
"type": "object",
"description": "Program update",
"properties": {
"name": {
"type": "string",
"description": "Program name",
"pattern": ".*",
"minLength": 1,
"maxLength": 52
},
"cost": {
"type": "integer",
"format": "int32",
"description": "Cost of the program as the estimated time it should take to complete (in seconds)",
"default": 600
},
"description": {
"type": "string",
"description": "Program description to help others understand the purpose of this program",
"pattern": ".*",
"minLength": 1,
"maxLength": 10000
},
"spec": {
"description": "Program information relevant to running this program",
"type": "object",
"properties": {
"backend_requirements": {
"description": "Backend characteristics, such as the number of qubits, required in order to run this program",
"type": "object",
"additionalProperties": true
},
"parameters": {
"description": "A user-defined schema for the program parameters",
"type": "object",
"additionalProperties": true
},
"return_values": {
"description": "A user-defined schema for the program results",
"type": "object",
"additionalProperties": true
},
"interim_results": {
"description": "A user-defined schema for the interim results",
"type": "object",
"additionalProperties": true
}
}
},
"tags": {
"title": "Tags",
"description": "List of job or program tags",
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"type": "string",
"pattern": ".*",
"minLength": 1,
"maxLength": 24
}
}
}
},
{
"type": "object",
"description": "Program metadata",
"properties": {
"is_public": {
"type": "boolean",
"description": "Indicates whether the program is public or private",
"default": false
}
}
}
],
"required": [
"name"
]
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Program ID"
},
"data": {
"type": "string",
"format": "byte",
"description": "Program text (base64 encoded string)"
},
"creation_date": {
"type": "string",
"description": "UTC timestamp for when the program was created",
"format": "date-time"
},
"update_date": {
"type": "string",
"description": "UTC timestamp for when the program was last updated",
"format": "date-time"
}
}
}
],
"description": "Program response"
}
List programs
Returns a list of all programs you uploaded and all public programs.
Query Parameters
Name, Type | Description |
---|---|
limit integer | Number of results to return at a time Default Value: 20 |
offset integer | Number of results to offset when retrieving the list of jobs Default Value: 0 |
name string | Program name |
search string | Searches for programs containing the specified value in their name or description. |
tags string[] | List of job or program tags |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | OK |
Code samples
curl -H "x-access-token: <YOUR-TOKEN>" \
https://runtime-us-east.quantum-computing.ibm.com/programs
Responses
{
"programs": [
{
"id": "sample-program-abcdef123456",
"name": "sample-program",
"cost": 18000,
"description": "A sample runtime program",
"creation_date": "2021-05-10T08:59:51Z",
"update_date": "2021-06-04T14:11:19Z",
"spec": {
"backend_requirements": {
"min_num_qubits": 5
},
"parameters": {
"properties": {
"iterations": {
"description": "Number of iterations to run. Each iteration generates and runs a random circuit.",
"type": "integer",
"minimum": 0
}
},
"$schema": "https://json-schema.org/draft/2019-09/schema",
"required": [
"iterations"
]
},
"return_values": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"result": {
"description": "A string that says \"All done!\"",
"type": "string"
}
}
},
"interim_results": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"iteration": {
"type": "integer",
"description": "Iteration number"
},
"counts": {
"type": "object",
"description": "Histogram data of the circuit result"
}
}
}
},
"is_public": true,
"tags": [
"tag1",
"tag2",
"tag3"
],
"summary": "A sample program response"
}
],
"count": 1,
"limit": 1,
"offset": 0
}
{
"title": "ProgramsResponse",
"type": "object",
"description": "Program collection response",
"properties": {
"programs": {
"type": "array",
"description": "A list of programs",
"items": {
"title": "ProgramResponse",
"allOf": [
{
"title": "ProgramMetadata",
"allOf": [
{
"title": "ProgramUpdate",
"type": "object",
"description": "Program update",
"properties": {
"name": {
"type": "string",
"description": "Program name",
"pattern": ".*",
"minLength": 1,
"maxLength": 52
},
"cost": {
"type": "integer",
"format": "int32",
"description": "Cost of the program as the estimated time it should take to complete (in seconds)",
"default": 600
},
"description": {
"type": "string",
"description": "Program description to help others understand the purpose of this program",
"pattern": ".*",
"minLength": 1,
"maxLength": 10000
},
"spec": {
"description": "Program information relevant to running this program",
"type": "object",
"properties": {
"backend_requirements": {
"description": "Backend characteristics, such as the number of qubits, required in order to run this program",
"type": "object",
"additionalProperties": true
},
"parameters": {
"description": "A user-defined schema for the program parameters",
"type": "object",
"additionalProperties": true
},
"return_values": {
"description": "A user-defined schema for the program results",
"type": "object",
"additionalProperties": true
},
"interim_results": {
"description": "A user-defined schema for the interim results",
"type": "object",
"additionalProperties": true
}
}
},
"tags": {
"title": "Tags",
"description": "List of job or program tags",
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"type": "string",
"pattern": ".*",
"minLength": 1,
"maxLength": 24
}
}
}
},
{
"type": "object",
"description": "Program metadata",
"properties": {
"is_public": {
"type": "boolean",
"description": "Indicates whether the program is public or private",
"default": false
}
}
}
],
"required": [
"name"
]
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Program ID"
},
"data": {
"type": "string",
"format": "byte",
"description": "Program text (base64 encoded string)"
},
"creation_date": {
"type": "string",
"description": "UTC timestamp for when the program was created",
"format": "date-time"
},
"update_date": {
"type": "string",
"description": "UTC timestamp for when the program was last updated",
"format": "date-time"
}
}
}
],
"description": "Program response"
}
},
"count": {
"type": "integer",
"description": "Total count of programs for the user"
},
"offset": {
"type": "integer",
"description": "Offset at which paginated results are returned"
},
"limit": {
"type": "integer",
"description": "Maximum number of results returned in a paginated response"
}
},
"required": [
"limit",
"offset"
]
}
List program details
Return information about the specified program.
Code samples
curl -H "x-access-token: <YOUR-TOKEN>" \
https://runtime-us-east.quantum-computing.ibm.com/programs/{id}
Responses
{
"id": "sample-program-abcdef123456",
"name": "sample-program",
"cost": 18000,
"description": "A sample runtime program",
"creation_date": "2021-05-10T08:59:51Z",
"update_date": "2021-06-04T14:11:19Z",
"spec": {
"backend_requirements": {
"min_num_qubits": 5
},
"parameters": {
"properties": {
"iterations": {
"description": "Number of iterations to run. Each iteration generates and runs a random circuit.",
"type": "integer",
"minimum": 0
}
},
"$schema": "https://json-schema.org/draft/2019-09/schema",
"required": [
"iterations"
]
},
"return_values": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"result": {
"description": "A string that says \"All done!\"",
"type": "string"
}
}
},
"interim_results": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"iteration": {
"type": "integer",
"description": "Iteration number"
},
"counts": {
"type": "object",
"description": "Histogram data of the circuit result"
}
}
}
},
"is_public": true,
"tags": [
"tag1",
"tag2",
"tag3"
]
}
{
"title": "ProgramResponse",
"allOf": [
{
"title": "ProgramMetadata",
"allOf": [
{
"title": "ProgramUpdate",
"type": "object",
"description": "Program update",
"properties": {
"name": {
"type": "string",
"description": "Program name",
"pattern": ".*",
"minLength": 1,
"maxLength": 52
},
"cost": {
"type": "integer",
"format": "int32",
"description": "Cost of the program as the estimated time it should take to complete (in seconds)",
"default": 600
},
"description": {
"type": "string",
"description": "Program description to help others understand the purpose of this program",
"pattern": ".*",
"minLength": 1,
"maxLength": 10000
},
"spec": {
"description": "Program information relevant to running this program",
"type": "object",
"properties": {
"backend_requirements": {
"description": "Backend characteristics, such as the number of qubits, required in order to run this program",
"type": "object",
"additionalProperties": true
},
"parameters": {
"description": "A user-defined schema for the program parameters",
"type": "object",
"additionalProperties": true
},
"return_values": {
"description": "A user-defined schema for the program results",
"type": "object",
"additionalProperties": true
},
"interim_results": {
"description": "A user-defined schema for the interim results",
"type": "object",
"additionalProperties": true
}
}
},
"tags": {
"title": "Tags",
"description": "List of job or program tags",
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"type": "string",
"pattern": ".*",
"minLength": 1,
"maxLength": 24
}
}
}
},
{
"type": "object",
"description": "Program metadata",
"properties": {
"is_public": {
"type": "boolean",
"description": "Indicates whether the program is public or private",
"default": false
}
}
}
],
"required": [
"name"
]
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Program ID"
},
"data": {
"type": "string",
"format": "byte",
"description": "Program text (base64 encoded string)"
},
"creation_date": {
"type": "string",
"description": "UTC timestamp for when the program was created",
"format": "date-time"
},
"update_date": {
"type": "string",
"description": "UTC timestamp for when the program was last updated",
"format": "date-time"
}
}
}
],
"description": "Program response"
}
Delete a program
Delete the specified program.
Update program metadata
Update the name, cost, description, or add more backend requirements, parameters, return values, and results. To update the actual program data, use the PUT endpoint instead.
Body Parameters (application/json)
Name, Type | Description |
---|---|
name string | Program name |
cost integer | Cost of the program as the estimated time it should take to complete (in seconds) Default Value: 600 |
description string | Program description to help others understand the purpose of this program |
spec | Program information relevant to running this program |
Tags string[] | List of job or program tags |
HTTP Response Status Codes
Status code | Description |
---|---|
204 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Update a program
Update the program data for the specified program. To update or add metadata, use the Patch endpoint instead.
Make a program public
Make a program that you uploaded publicly available. Others will be able to view and run the program, but only you will be able to edit it.