HSTX
Connect the AI API and make your first request
Project keys, base URL, available models, a Python request, allowances and safe retries.
Endpoint and credentials
HSTX base URL:
https://ai.hstx.cloud/v1
Open Account → AI, create a project key, choose allowed models and fund an allowance. Store the full key when it is issued or rotated. HSTX account passwords and third-party provider keys are not substitutes for this API key.
Start with GET /models using Authorization: Bearer YOUR_HSTX_KEY. Take an allowed model ID from that response or the HSTX catalog.
Python example
Set HSTX_API_KEY and HSTX_MODEL in the server environment. This example uses Python's standard library:
import json, os, urllib.request, uuid
base = "https://ai.hstx.cloud/v1"
headers = {"Authorization": "Bearer " + os.environ["HSTX_API_KEY"],
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4())}
body = {"model": os.environ["HSTX_MODEL"],
"messages": [{"role": "user", "content": "Reply in one sentence"}],
"max_tokens": 128}
request = urllib.request.Request(base + "/chat/completions",
data=json.dumps(body).encode(), headers=headers, method="POST")
with urllib.request.urlopen(request, timeout=120) as response:
print(response.read().decode())
After a lost response, a retry of the same request needs the same idempotency key and body. A new key represents a new request and may consume allowance again. Avoid unlimited automatic retries.
Application settings
Clients supporting OpenAI-compatible Chat Completions with a custom base URL can use the address above, an HSTX key and an allowed model ID. Some clients append /v1; avoid ending up with /v1/v1. Individual editors and all of their features are not guaranteed compatible.
Keep keys in server-side secrets, not public frontend code or URL parameters. Use separate project keys and finite allowances.
The price is shown before payment. Billed units depend on the model, mode and caching; they are not interchangeable with raw input tokens. HSTX logs metadata and state, not prompt or response text.
For 401, check the key and Bearer header. For 403, review permissions/model policy. For 429, reduce request frequency and respect Retry-After. For 5xx or network failures, check the result before retrying. Model/media availability depends on actual activation for the key.