Before you start
You need a Compute account, a Compute API key, a terminal withcurl, and an SSH key pair. Set HIVENET_API_KEY securely in your environment.
For a prepaid account, make sure the balance covers one hour of the selected preset.
The examples use the production base URL, https://api.hivecompute.ai/v1. Replace every YOUR_... placeholder before sending a request.
1. Choose a region and preset
List region codes:FR:
pagination.next is not null. Look up the preset again before each create. A preset can be retired or its size and price can change.
Preset cpu, memory, and storage are numeric strings without units. hourly_price and price_discounted are decimal strings; an empty price_discounted means no preset discount. Convert strings explicitly when comparing values. Do not treat an empty discount as a zero price.
2. Choose an image
For a VM:type=container and follow pagination.next if another page is available. Select an image compatible with the preset. A GPU VM needs gpu_supported: true. Check the minimum memory and disk size and save the image’s id.
The image endpoint does not filter by region. Some VM minimum-size fields are zero in this release; do not interpret zero as a sizing recommendation.
3. Register your SSH public key
New instances use the public key you registered most recently in the API or console. If that is the key you want, skip to step 4. To use another key for future instances, create a localssh-key.json file.
.pub file, then send it:
201 Created. Save the returned key id; Get SSH key lets you retrieve it later. Repeating registration creates a new record, even for identical key content.
4. Create the instance
image_type to container and use a container image ID. The minimal request above uses the account’s registered SSH key without a key-selection field.
Expect 201 Created and save instance.instance_id. If the response contains only that ID inside instance, creation succeeded. Use it in the next step. When available, hourly_rate on the instance is the billed rate in credits per hour, returned as a JSON number.
If creation returns 409 CONFLICT, check credit, capacity, and whether the preset changed during the request. A no-capacity response does not include Retry-After. Choose another compatible preset or try later.
5. Check readiness and connect
Poll the instance:status is RUNNING. Applications inside the instance may still be starting.
If the instance reaches ERRORED, inspect its logs and console details before trying another creation.
Open the instance in the Compute console and use the connection command shown there. Keep any supplied host, port, and connection options.
Manage the instance
Use Work with instances to stop, restart, read logs and metrics, or terminate it.Termination permanently deletes the instance and its data. Use stop if you need to keep the instance for later.