Skip to content

xCloud AI Management API

Overview

With the management API, you control private models from scripts, CI pipelines, or your own tools, just as in the web app. The page Models and deployments describes how to import and delete models, query flavors and engines, start, change, restart, and end deployments, and read the start log and usage.

You manage service accounts and their keys exclusively in the web app (see Access).

Requests to the models themselves don't go through this API but to the OpenAI-compatible endpoint (see Using models).

The API uses JSON for requests and responses and standard HTTP methods: GET reads, POST creates or triggers actions, PATCH changes, and DELETE deletes.

Base URL

All paths in this documentation are relative to the following base URL:

https://control.ai.xcloud.eu/v1

For example, the list of your deployments is available at https://control.ai.xcloud.eu/v1/model-placements.

Authentication

The API authenticates requests with a service account's key for deployments. Only a service account with Import models: Allowed has this key. You create it in the web app (see Create a service account); the key is shown only once.

The key applies to the project in which the service account is located. It only acts on the models and deployments of that project; the paths therefore don't contain the project.

Send the key in the Authorization header of every request:

export XCLOUD_AI_CONTROL_TOKEN='<key for deployments>'
export XCLOUD_AI_API='https://control.ai.xcloud.eu/v1'

curl "$XCLOUD_AI_API/model-placements" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN"

A service account's key for requests only applies to requests to the models; the management API rejects it with 401.

Relationship to the web app

What a program creates via the API appears in the web app in the same lists, with the note via API by and the name of the service account. Billing is the same as for actions in the web app (see Billing). The API writes names with a hyphen instead of a dot (see Names).

The rules of the web app apply to calls via the API:

  • A deployment runs on a flavor from GET /compute/flavors, with exactly one instance, only from an imported model, and only if a card is free immediately.
  • Without a valid payment method, no imports or deployments are possible.

xCloud reverts whatever violates these rules; it appears in the web app as Failed. xCloud resets a different number of instances to one.

Getting started

The Qwen3.8-27B example shows step by step how to import a model via the API, deploy it, and make the first request. Models and deployments describes all endpoints in detail.

Lists

Without further parameters, list endpoints return the complete list in the items field. To fetch page by page, specify limit (1 to 500). As long as more entries follow, the response contains hasMore: true and a nextCursor, which you append as cursor to the next request. Lists are sorted by name. With state, you filter by phase, e.g. state=Ready,Failed.

curl "$XCLOUD_AI_API/model-placements?limit=50" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN"

Repeatable requests

Requests that create something (POST) accept the Idempotency-Key header with 1 to 255 printable ASCII characters. If you send the same request with the same key again within 24 hours, the API responds with the result of the first request and the header Idempotent-Replayed: true; nothing is created twice. The same key with different content is rejected with 409 and the code idempotency_conflict. This lets you safely repeat a request after a network error.

curl -X POST "$XCLOUD_AI_API/model-placements" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN" \
  -H "Idempotency-Key: deploy-qwen3-8-27b-2026-11-12" \
  -H "Content-Type: application/json" \
  -d @placement.json

Errors

Errors are returned as a JSON object:

{
  "error": "<description of the error>",
  "code": "NoCapacity",
  "requestId": "3f1c9a7e2b",
  "details": [
    {"field": "flavor", "reason": "invalid", "message": "<description>"}
  ]
}
Field Description
error Description of the error; the text may change
code Fixed reason for evaluation in your program
requestId ID of the request, equal to the X-Request-Id header
details For invalid fields: field (field), reason (reason), message (text)

Include the requestId when you contact support about an error.

Code Status Meaning
invalid_request 400 Content or parameters can't be read
validation_failed 400 A field is invalid; details names it
unauthenticated 401 The key is missing or invalid
forbidden 403 The key lacks a permission
not_found 404 The object doesn't exist
gone 410 The object no longer exists
already_exists 409 The name is already taken
conflict 409 The state doesn't allow the action
NoCapacity 409 No card is free for the flavor
quota_exceeded 409 A limit has been reached, e.g. the GPU limit
idempotency_conflict 409 The same Idempotency-Key with other content
internal 500 Error on the xCloud side
unavailable 503 The service is temporarily unavailable