Skip to Content
DocsAPIAccount Level APIsTerminal Management

Terminal Management API

This document describes how to use the account-level Terminal Management API, which allows you to manage terminals using your account API key.

API Description

POST https://api.ticos.ai/v1/terminals

Request Headers

ParameterRequiredDescription
Content-TypeYesFixed value: application/json
AuthorizationYesFormat: Bearer <account_api_key>, API key can be obtained from User Menu → API Keys

Request Body

The request body is in JSON format and contains the following fields:

{ "name": "name_1", "identifier": "id_1", "model_id": 123, "description": "Terminal of model 123" }

Request Body Fields

FieldTypeRequiredDescription
namestringYesA user-defined name for the terminal
identifierstringYesA unique identifier for the terminal
model_idintegerYesThe model ID associated with this terminal
descriptionstringNoA description for the terminal

Response

Success Response

After a successful call, the service returns JSON with HTTP status code 201 Created:

{ "name": "name_1", "identifier": "id_1", "status": "active", "model_id": 123, "secret": "ts_d2d5495765f1cdecd290b4a2d291b180", // This is the terminal's secret "description": "Terminal of model 123" }

Error Responses

  • 400 Bad Request: Invalid input (e.g., missing required fields, identifier not unique).
    { "detail": "A terminal with this identifier already exists for this model" }
  • 401 Unauthorized: Authentication failed (e.g., invalid account API key).
  • 500 Internal Server Error: Server-side error.

Example Code

cURL

curl -X POST "https://api.ticos.ai/v1/terminals" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <account_api_key>" \ -d '{ "name": "name_1", "identifier": "id_1", "model_id": 123, "description": "Terminal of model 123" }'

Python

import requests import json url = "https://api.ticos.ai/v1/terminals" headers = { "Content-Type": "application/json", "Authorization": "Bearer <account_api_key>" } data = { "name": "name_1", "identifier": "id_1", "model_id": 123, "description": "Terminal of model 123" } response = requests.post(url, headers=headers, data=json.dumps(data)) result = response.json() print(result)

Common Issues

IssueSolution
Returns 400 Bad RequestCheck if all required fields are provided and the identifier is unique
Returns 401 UnauthorizedCheck if the API key in the Authorization header is correct and if the key has been revoked