Serverless Quickstart
Make a first authenticated Serverless request using a live model slug.
Prepare the account and request boundary
Use an active, email-verified account with available wallet funds. Create a backend API key with pricing:read for discovery and inference:write for generation. Check expiry and IP restrictions. Keep the token in your application's secret store; never embed it in public code or a support message. See API-key setup.
Discover a public model ID
curl --fail-with-body --max-time 30 https://serverless.hostnotgpu.ae/v1/models \
-H "Authorization: Bearer $HOSTNOTGPU_API_KEY"
This GET discovers models; it does not run generation. Read the data array and select a text model's public id. Record modality, context length and pricing. Empty results and failed discovery are different states. The response has no streaming/tool flags and does not reserve capacity.
Prepare one bounded chat operation
The following JSON is a body template for POST /v1/inference/chat on the same host. Replace the model placeholder. Sending it performs billable generation. Add Content-Type application/json, bearer authentication and a non-empty Idempotency-Key of at most 255 characters. Store that key for this logical operation before dispatch.
{"model":"MODEL_ID_FROM_DISCOVERY","messages":[{"role":"user","content":"Explain one GPU use in one sentence."}],"max_tokens":64,"stream":false}
Chat permits 1–100 messages using system, user or assistant roles and string content, at most 50,000 characters per message. The output bound is 1–8192 tokens; the model's actual context can be more restrictive. Streaming and unknown fields are rejected. Input tokens plus generated output must fit the selected model.
Verify success and interpret failure
Check status and Content-Type before JSON parsing. Successful chat uses inference.result with output.type: text and output.text, plus usage, billing and latency. Do not read an assumed choices array. Render generated text as untrusted input and preserve money as decimal strings.
A 400 requires corrected input; 401/403 requires credential or account review; 402 requires available-funds review; 404/409 requires model or pricing review. Reduce admission on 429 and honor Retry-After when supplied. A timeout or 5xx may leave delivery uncertain: retain the original key and request ID and reconcile before retrying. Aborting your client is not confirmed remote cancellation.
Complete the first evaluation
Compare output quality, end-to-end latency and returned billing against your acceptance criteria. Inspect workspace records for unresolved reservations; GPU-only /usage is not an inference export. Test failure paths locally before increasing paid concurrency. Continue with the exact API contract, error decision tree and wallet terminology.
Published · Updated