Quick start
On this page you create a token, send your first request, and create and delete a cloud server. The examples use the Cloud API; every other product follows the same pattern.
Before you start
- An Arianet account with wallet balance (creating a server costs money; reading lists is free)
curl, the Arianet CLI, or any language that speaks HTTP
1. Create a token
- Sign in to the panel and open the API tokens page.
- Create a token with the
cloud:servers:readandcloud:servers:writescopes. - Copy the token; it is shown only once.
Scopes and IP restrictions are covered in Authentication.
2. Put the token in an environment variable
Do not write the token into your code; keep it in the ARIANET_TOKEN environment variable. The CLI reads the same variable.
- macOS / Linux
- Windows (PowerShell)
export ARIANET_TOKEN="paste-your-token-here"
$env:ARIANET_TOKEN = "paste-your-token-here"
3. Send your first request
List the cloud servers of your account (an empty list if you have none):
- curl
- CLI
- Python
- Node.js
- Go
curl -s https://api.ariaservice.net/cloud/v1/servers \
-H "Authorization: Bearer $ARIANET_TOKEN"
arianet cloud servers list
import os
import requests
resp = requests.get(
"https://api.ariaservice.net/cloud/v1/servers",
headers={"Authorization": f"Bearer {os.environ['ARIANET_TOKEN']}"},
timeout=30,
)
resp.raise_for_status()
for server in resp.json()["data"]:
print(server["id"], server["name"], server["status"])
const resp = await fetch('https://api.ariaservice.net/cloud/v1/servers', {
headers: {Authorization: `Bearer ${process.env.ARIANET_TOKEN}`},
});
if (!resp.ok) throw new Error(`${resp.status} ${await resp.text()}`);
const {data} = await resp.json();
for (const server of data) console.log(server.id, server.name, server.status);
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.ariaservice.net/cloud/v1/servers", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("ARIANET_TOKEN"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var body struct {
Data []struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
} `json:"data"`
}
if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
panic(err)
}
for _, s := range body.Data {
fmt.Println(s.ID, s.Name, s.Status)
}
}
A 401 means the token was not sent correctly; a 403 means it lacks a scope (authentication errors).
4. Create your first server
Find a datacenter, a plan and an image, then create the server:
- curl
- CLI
BASE=https://api.ariaservice.net/cloud/v1
AUTH="Authorization: Bearer $ARIANET_TOKEN"
curl -s $BASE/datacenters -H "$AUTH" # datacenter codes, e.g. ovh
curl -s "$BASE/plans?datacenter=ovh" -H "$AUTH" # plan ids and prices
curl -s "$BASE/images?type=system" -H "$AUTH" # image names, e.g. ubuntu-24.04
curl -s -X POST $BASE/servers -H "$AUTH" -H "Content-Type: application/json" \
-d '{"name":"web-1","datacenter":"ovh","plan_id":3,"image":"ubuntu-24.04"}'
arianet cloud datacenters
arianet cloud plans --datacenter ovh
arianet cloud images list --type system
arianet cloud servers create --name web-1 --datacenter ovh --plan 3 --image ubuntu-24.04 --wait
The create call answers 201 with the server, the action_id of the create action and a root_password. The root password is shown only this once. Creating a server is asynchronous; poll the action until its status is success or error:
curl -s $BASE/actions/812 -H "$AUTH"
# {"data":{"id":812,"command":"create","status":"running","progress":40,...}}
5. Clean up
Cloud servers are billed by the hour. If you were only trying things out, delete the server:
curl -s -X DELETE $BASE/servers/<id> -H "$AUTH"
# or: arianet cloud servers delete <id>