Skip to content
v0.8.4stable

Use an existing Gateway Key

This path is for an application developer who has a Gateway Key and a public model alias. You do not need Admin Console access or the identity of the upstream provider.

Before you start
ItemExampleSource
Instance URLhttps://halro.example.comYour administrator; Halro has no universal hosted URL
Gateway Keygw_ followed by 43 charactersShown once when the administrator creates it
Route aliaschatA public name defined by the administrator
Terminal window
read -r -s HALRO_GATEWAY_KEY
printf '\n'
export HALRO_GATEWAY_KEY
Terminal window
curl https://halro.example.com/v1/chat/completions \
-H "Authorization: Bearer $HALRO_GATEWAY_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "chat",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Introduce Halro in one sentence."}]
}'

Set an explicit output limit. It bounds provider output and the conservative budget reservation used when the network result is uncertain. This example uses max_tokens instead of max_completion_tokens: the latter is declared unsupported on the DeepSeek path, and the public alias does not reveal which path will be selected.

Interpret the first failure
HTTPCodeMeaning and next action
401invalid_api_keyMissing, malformed, revoked, or wrong key. Ask for a new Gateway Key; do not substitute a Provider key.
404model_not_foundNo Route has this alias. Confirm the public alias with the administrator.
403model_not_allowedThe Route exists but your Project is not authorized for it.
400unsupported_featureNo eligible target supports the requested operation or field. Remove the feature or ask about eligible Deployment/Profile combinations.
503provider_unavailableNo healthy eligible Deployment. Apply bounded backoff.
403token_guard_blockedA fixed threshold or temporary block rejected the request before Provider I/O. Do not retry blindly.
429several codesThe retry decision depends on the exact code and whether Retry-After is present.

Halro does not expose GET /v1/models on the Gateway. Public aliases belong to the Project and do not reveal their upstream targets. See authentication, request headers, and errors for client handling.

The alias alone cannot answer. A Route can contain multiple Deployments bound to different Provider Profiles. A field is available only when eligible targets remain after capability filtering, not because an alias implies one fixed Profile.

You have three practical options:

  1. Probe directly. Send a minimal request with tools. An unsupported request is rejected before Provider I/O, so it incurs no Provider cost and cannot return a partial answer.
  2. Ask a precise administrator question. Ask which Deployment/Profile targets remain eligible for chat when tools are requested and whether fallback is permitted; compare each target with the Chat Completions reference.
  3. Implement degradation. Branch on the stable unsupported-feature error and retry the business action without tools only when that behavior is acceptable.

See Scenario 1 for complete Project, Key, and Route separation across environments.

Remove the key when the shell no longer needs it:

Terminal window
unset HALRO_GATEWAY_KEY