Serverless

Serverless GPU Inference: Getting Started

A safe first-request workflow for discovering a model, storing an API key, sending a request, and interpreting errors.

By Hostnot GPU ·

Serverless inference turns a supported model invocation into an HTTP request. On Hostnot GPU, start with the public model catalog and the actual inference schema: there is no customer GPU operating system to configure for this workflow, but credentials, wallet authorization, input bounds and response handling still belong in your application design.

Discover a usable model before submitting work

Use https://serverless.hostnotgpu.ae/v1 as the base URL. GET /models requires a key with pricing:read; inference requires inference:write. The account must be active and email-verified, and key expiry, revocation and configured IP restrictions apply. Follow API key setup and keep the bearer token on your backend.

curl --fail-with-body --max-time 30 \
  https://serverless.hostnotgpu.ae/v1/models \
  -H "Authorization: Bearer $HOSTNOTGPU_API_KEY"

This is a discovery request, not generation. The response has a data array. Choose its public id, inspect modality, context length and displayed pricing, and record the choice in your configuration. Visibility does not reserve capacity or prove that every model feature is accepted by the public request handler.

Construct the smallest meaningful chat request

The following is a request-body template for POST /inference/chat, not an executed operation. Replace the model placeholder with a discovered text model. Sending it performs billable inference and requires a non-empty Idempotency-Key header of at most 255 characters.

{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "messages": [{"role": "user", "content": "Explain one use of a GPU."}],
  "max_tokens": 128,
  "stream": false
}

Chat accepts 1–100 messages with system, user or assistant roles and string content of at most 50,000 characters per message. max_tokens is an integer from 1 to 8192, defaulting to 1024. Those are schema ceilings, not a promise that a model can handle every combination: context must also accommodate the tokenized input and output. Unknown fields and stream: true are rejected.

Read the result and account for the operation

Successful chat returns a normalized inference.result object. Read output.type and output.text, with usage, billing and latencyMs alongside them; do not assume an OpenAI choices array. Money remains decimal text. Validate the shape before showing output, and render model text as untrusted data.

The wallet reserves an estimate before generation and settles delivered work. For chat, the authorization uses message character counts as a conservative usage input plus the requested output ceiling; this is not the tokenizer's measured count. Reported usage informs settlement, with an estimate fallback when usage is missing. See reservations and available funds.

Make the first integration observable

Set a deadline, bound concurrent requests, and log status, UTC time and X-Request-Id without prompts or authorization headers. A disconnected client does not prove that generation stopped. Keep the operation's key for reconciliation; it is not a universal cached-response or exactly-once guarantee. Use the failure decision tree before retrying and the serverless quickstart for the account workflow.