Skip to main content

Overview

The OpenStack Compute API provides programmatic control over virtual machine instances, flavors, keypairs, availability zones, server groups, and hypervisor resources. The API follows RESTful conventions with JSON request and response bodies.
Prerequisites
  • A valid project-scoped token from the Identity API
  • Base URL: https://api.<your-domain>/compute/v2.1
  • Minimum API microversion: 2.1

API Versioning (Microversions)

The Compute API uses microversions to add new capabilities without breaking existing clients. Specify the desired microversion in the X-OpenStack-Nova-Microversion header:
Request with specific microversion
Query supported microversions

Key Endpoints


Create an Instance

string
required
Display name for the instance.
string
required
Flavor ID or URL. Determines vCPU, RAM, and disk allocation.
string
required
Image ID or URL to boot from. Omit when booting from volume.
array
required
List of network objects. Each must include uuid (network ID) or port (port ID).
string
SSH keypair name to inject into the instance for key-based authentication.
array
List of security group name objects. Defaults to the default group.
string
Base64-encoded cloud-init user data script executed at first boot.
string
Target availability zone. Omit to let the scheduler choose.

Instance Actions

Perform operations on a running instance via the /action endpoint:
Soft reboot (graceful OS restart)
Hard reboot (power cycle)

List Instances with Filtering

List all running instances
List instances with full details
List instances across all projects (admin)
Common filter parameters:

Error Reference


Next Steps

Storage API

Attach volumes and manage snapshots via the Storage API

Networking API

Create networks and assign floating IPs for your instances

Authentication

Manage tokens and application credentials