Zum Hauptinhalt springen

ONE WARE Cloud REST-API

The ONE WARE Cloud provides a REST API for programmatic access to your projects, jobs, credits, and AI models. All endpoints are documented in the interactive API documentation (Scalar).


Authentication

The API uses Bearer JWT authentication. To use the API outside of a browser session, you need to:

  1. Create an API Key
  2. Exchange the API Key for a Bearer JWT token
  3. Use the JWT in the Authorization header for subsequent requests
Warnung

JWT tokens have an expiration time. You must renew the token before it expires. If you receive a 401 Unauthorized response, exchange your API key for a new token.


Creating an API Key

  1. Navigate to Account → API Keys in the OneWare Cloud

  2. Click Add new API Key and enter a descriptive name

  3. Copy the generated key immediately — it will not be shown again after closing the dialog


Exchanging an API Key for a JWT

Send a POST request to the auth endpoint with your API key in the x-api-key header:

curl -X POST https://cloud.one-ware.com/api/auth/token \
-H "x-api-key: YOUR_API_KEY"

The response body contains the JWT token as a plain string:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

Use this token in the Authorization header for all subsequent requests:

curl https://cloud.one-ware.com/api/credits/balance \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

API Endpoints Overview

CategoryEndpointsDescription
AuthPOST /api/auth/tokenExchange API key for JWT
CreditsGET /api/credits/balanceGet current credit balance
GET /api/credits/transactionsList credit transactions
GET /api/credits/balance/sufficientCheck if balance is sufficient
ProjectsGET /api/projectsList all projects (paginated)
GET /api/projects/{projectId}Get project details
GET /api/projects/{projectId}/downloadDownload project
DELETE /api/projects/{projectId}Delete a project
JobsGET /api/jobsList all jobs (paginated)
GET /api/jobs/{jobId}Get job details
GET /api/jobs/{jobId}/progressGet job progress
GET /api/jobs/{jobId}/logsGet job logs
POST /api/jobs/{jobId}/stopStop a running job
ONE AI ModelsGET /api/oneai/projects/{projectId}/modelsList models
POST /api/oneai/projects/{projectId}/models/{modelId}/trainStart training
POST /api/oneai/projects/{projectId}/models/{modelId}/testStart testing
POST /api/oneai/projects/{projectId}/models/{modelId}/exportExport model
ONE AI ExportsGET /api/oneai/projects/{projectId}/models/{modelId}/exportsList exports
GET /api/oneai/projects/{projectId}/models/{modelId}/exports/{exportName}Download export

Usage Examples

Get Credit Balance

curl https://cloud.one-ware.com/api/credits/balance \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

List Projects

curl "https://cloud.one-ware.com/api/projects?skip=0&take=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Start Training a Model

curl -X POST https://cloud.one-ware.com/api/oneai/projects/{projectId}/models/{modelId}/train \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"epochs": 100}'

Check Job Progress

curl https://cloud.one-ware.com/api/jobs/{jobId}/progress \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Python Example

import requests

API_KEY = "your-api-key-here"
BASE_URL = "https://cloud.one-ware.com"

# Step 1: Exchange API key for JWT
response = requests.post(
f"{BASE_URL}/api/auth/token",
headers={"x-api-key": API_KEY}
)
token = response.text.strip('"')

# Step 2: Use JWT for authenticated requests
headers = {"Authorization": f"Bearer {token}"}

# Get credit balance
balance = requests.get(f"{BASE_URL}/api/credits/balance", headers=headers)
print(f"Balance: {balance.json()}")

# List projects
projects = requests.get(f"{BASE_URL}/api/projects?skip=0&take=10", headers=headers)
print(f"Projects: {projects.json()}")

# List jobs
jobs = requests.get(f"{BASE_URL}/api/jobs?skip=0&take=5", headers=headers)
print(f"Jobs: {jobs.json()}")

Error Responses

Status CodeDescription
400Bad Request — invalid parameters
401Unauthorized — invalid or expired JWT
402Payment Required — insufficient credits
404Not Found — resource does not exist

Interactive Documentation

For a full reference of all endpoints, request/response schemas, and the ability to test requests directly, visit the Scalar API Documentation.