Analytics
Get analytics filters
Get analytics filters
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access
quantum-computing.account-analytics-filters.read
Auditing
Calling this method generates the following auditing events.
quantum-computing.account-analytics-filters.read
Input
Name, Type | Description |
|---|---|
instance string[] | Example: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/filters
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/filters' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/filters
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/filters",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Output
Status code | Description |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"backends": [
{
"name": "simulator"
}
],
"instances": [
{
"id": "crn:v1:staging:public:quantum-computing:region:a/account:",
"deleted": true
}
],
"users": [
{
"id": "123"
}
],
"plans": [
{
"name": "premium"
}
],
"subscriptions": [
{
"id": "7f666d17-7893-47d8-bf9d-2b2389fc4dfc",
"name": "premium"
}
]
}{
"type": "object",
"properties": {
"backends": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "simulator"
}
},
"required": [
"name"
]
}
},
"instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "crn:v1:staging:public:quantum-computing:region:a/account:"
},
"deleted": {
"type": "boolean"
}
},
"required": [
"id",
"deleted"
]
}
},
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "123"
}
},
"required": [
"id"
]
}
},
"plans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "premium"
}
},
"required": [
"name"
]
}
},
"subscriptions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "7f666d17-7893-47d8-bf9d-2b2389fc4dfc"
},
"name": {
"type": "string",
"example": "premium"
}
},
"required": [
"id",
"name"
]
}
}
},
"required": [
"backends",
"instances",
"users",
"plans",
"subscriptions"
]
}Get usage analytics
Get usage analytics
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access
quantum-computing.account-analytics-usage.read
Auditing
Calling this method generates the following auditing events.
quantum-computing.account-analytics-usage.read
Input
Name, Type | Description |
|---|---|
instance string[] | Example: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | Example: "2024-01-01T00:00:00.000Z" |
interval_end string | Example: "2024-01-01T00:00:00.000Z" |
backend string[] | Quantum backends to filter by. Note: functions have no backend association and are omitted when this filter is active. Example: "ibm_tenerife" |
user_id string[] | Example: "123" |
simulators boolean | Include simulators Default value: true |
plan string[] | Example: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Example: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Example: ["sampler"] |
If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Output
Status code | Description |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}{
"type": "object",
"properties": {
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds). Sum of sessions, individual jobs, and functions quantum usage."
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units). Sum of sessions, individual jobs, and total functions usage (quantum, classical, and license cost)."
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}Get usage analytics grouped
Get usage analytics grouped
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access
quantum-computing.account-analytics-usage.read
Auditing
Calling this method generates the following auditing events.
quantum-computing.account-analytics-usage.read
Input
Name, Type | Description |
|---|---|
group_by Required string | key to group usage by Possible values: instancebackenduser_idplansubscription_idfunction_nameExample: "instance" |
instance string[] | Example: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | start date Example: "2024-01-01T00:00:00.000Z" |
interval_end string | end date Example: "2024-01-01T00:00:00.000Z" |
backend string[] | backend to filter by Example: "ibm_tenerife" |
user_id string[] | Example: "123" |
simulators boolean | Include simulators Default value: true |
plan string[] | Example: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Example: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Example: ["sampler"] |
If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Output
Status code | Description |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"data": [
{
"key": "ibm-q/main/open",
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}
]
}{
"type": "object",
"properties": {
"data": {
"description": "Data",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "ibm-q/main/open",
"description": "Grouping key",
"nullable": true
},
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds)"
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units)"
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"key",
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}
}
},
"required": [
"data"
]
}Get usage analytics grouped by date
Get usage analytics grouped by date
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access
quantum-computing.account-analytics-usage.read
Auditing
Calling this method generates the following auditing events.
quantum-computing.account-analytics-usage.read
Input
Name, Type | Description |
|---|---|
group_by Required string | key to group usage by Possible values: instancefunction_nameExample: "instance" |
instance string[] | Example: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | Example: "2024-01-01T00:00:00.000Z" |
interval_end string | Example: "2024-01-01T00:00:00.000Z" |
backend string[] | Example: "ibm_tenerife" |
user_id string[] | Example: "123" |
simulators boolean | Include simulators Default value: true |
plan string[] | Example: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Example: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Example: ["sampler"] |
If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' If your instance is in the eu-de region, use this URL instead: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Output
Status code | Description |
|---|---|
| 200 | |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"interval_start": "2024-01-01T00:00:00.000Z",
"interval_end": "2024-01-01T00:00:00.000Z",
"data": [
{
"key": "ibm-q/open/main",
"interval_start": "2024-01-01T00:00:00.000Z",
"interval_end": "2024-01-01T00:00:00.000Z",
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}
]
}{
"type": "object",
"properties": {
"interval_start": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval start"
},
"interval_end": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval end"
},
"data": {
"description": "Results",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "ibm-q/open/main",
"description": "Group key. Depends on the groupBy query params."
},
"interval_start": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval start"
},
"interval_end": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval end"
},
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds)"
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units)"
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"key",
"interval_start",
"interval_end",
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}
}
},
"required": [
"interval_start",
"interval_end",
"data"
]
}